Esempio n. 1
0
 def __init__(self):
     self.site = pywikibot.Site("en", "wikipedia")
     self.categories = [
         Category(self.site, "Category:Pages using citations with accessdate and no URL"),
         Category(self.site, "Category:Pages with archiveurl citation errors"),
         Category(self.site, "Category:Pages with citations having wikilinks embedded in URL titles"),
         Category(self.site, "Category:Pages with empty citations")
     ]
     self.doTaskPage = pywikibot.Page(self.site, "User:Hazard-Bot/DoTask/21")
     self.citationTemplates = self.getAllTitles("Template:Citation")
     citationTemplatesCategory = Category(self.site, "Category:Citation Style 1 templates")
     for page in citationTemplatesCategory.articles():
         if ("/" not in page.title()) and (page.namespace() == 10):
             self.citationTemplates.extend(self.getAllTitles(page.title()))
     self.subscription = self.getAllTitles("Template:Subscription required")
     self.lang = self.getAllTitles("Template:Lang")
     self.lang.extend(self.getAllTitles("Template:Rtl-lang"))
     self.loadLanguages("User:Hazard-Bot/Languages.css")
     self.citationNeededTemplate = mwparserfromhell.nodes.template.Template(
         "citation needed",
         params = [
             mwparserfromhell.nodes.extras.parameter.Parameter(
                 "date",
                 "{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"
             )
         ]
     )
Esempio n. 2
0
            while True:
                p = Corellations().print_stats()
                os.system('clear')
                print p
                time.sleep(10)
        else:
            while True:
                os.system('clear')
                Corellations().print_sel()
                time.sleep(10)

    else:
        site = wikipedia.getSite()
        cat = Category(site, u"Категория:Музыка")
        x=0
        #while True:
        for p in cat.articles(recurse=3):
            print p
            p.purgeCache()
        #    p = site.randompage()
        #    if (p.namespace() == 0) and (not p.isDisambig()) and (not p.isRedirectPage()):
        #        Evaluate(p.title()).run()
        #        x += 1
        #        print x
        #        #if x == 10:
        #        #    time.sleep(10)
        #        #    x = 0


# SELECT name, len from quality where (len < (select avg(len) from quality) / 4 and cats < (select avg(len) from quality) / 4) order by len;