Beispiel #1
0
 def __init__(self):
     robot.Robot.__init__(self, task=22)
     self.startLogging(pywikibot.Page(self.site, 'User:Legobot/Logs/22'))
     self.cat = pywikibot.Category(
         self.site, "Category:Non-free images for NFUR review")
     self.gen = self.cat.articles(namespaces=[6], content=True)
     self.AWBGenFixes = awb_gen_fixes.AWBGenFixes(self.site)
     self.AWBGenFixes.load()
     self.AWBGenFixes.load_redirects(
         pywikibot.Page(self.site, 'User:Legoktm/AWB/TR'))
     self.stop_page = pywikibot.Page(self.site, 'User:Legobot/Stop/22')
 def __init__(self, domain):
     self.site = pywikibot.Site()
     self.AWB = awb_gen_fixes.AWBGenFixes(self.site)
     self.tag = '{{dead link|date=%s|bot=Legobot}}' % datetime.datetime.today().strftime('%B %Y')
     self.domain = domain
     self.simulate = False
     if self.domain.startswith('*.'):
         self.clean = self.domain[2:]
     else:
         self.clean = self.domain
     self.matching = re.compile('https?://(www\.)?(.*?)'+re.escape(self.clean))
Beispiel #3
0
 def __init__(self):
     #robot.Robot.__init__(self, task=23)
     self.site = pywikibot.Site()
     self.AWB = awb_gen_fixes.AWBGenFixes(self.site)
     self.stop_page = pywikibot.Page(self.site, 'User:Legobot/Stop/II 2')
     self.summary_end = '. Errors? [[User:Legobot/Stop/II 2|stop me]]'
Beispiel #4
0
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
"""
import re

import pywikibot
import mwparserfromhell

import urlregex
import awb_gen_fixes
SITE = pywikibot.Site()
AWB = awb_gen_fixes.AWBGenFixes(SITE)
AWB.load()

LOG = '==~~~~~=='
TEMPLATES = ['ODNBsub', 'OEDsub']


def process_page(page):
    text = page.get()
    text, blah = AWB.do_page(text, date=False)
    state = text
    #find ref tags
    for tag in re.finditer(r'<ref(.*?)>(.*?)</ref>', text):
        for template in mwparserfromhell.parse(
                tag.group(2)).filter_templates():
            name = template.name.lower().strip()