##LemmeyBot.py##User:LemmeyBOT##Author:Lemmey##Requires:RefHistoryFix.py##Attempts to repair articles in the broken references category##Tagline:If it ain't broken, you're not overreading the policy/guideline/essay enoughimportwikipedia,catlib,config,pagegeneratorsimportRefHistoryFiximportcategoryimportos,timeimportstringclassCategoryPages:def__init__(self,catTitle):self.cat=catlib.Category(wikipedia.getSite(),'Category:'+catTitle)defrun(self):listOfArticles=self.cat.articlesList()array=[]f=open('list.txt','r')text=f.readlines()f.close()ignorelist=[]forlineintext:line.split()line=line.lstrip('[')line=line.rstrip(']\n')ignorelist.append(line)forarticleinlistOfArticles:ifnotarticle.isImage()andnotarticle.isCategory():ifnotarticle.isTalkPage():ifarticle.title()notinignorelist:if"User"notinarticle.title()and"Wikipedia"notinarticle.title()and"Portal"notinarticle.title():array.append(article.title())printlen(array)," articles"count=0fortitleinarray:try:run_job(title)count+=1ifcount==10:count=0print"BOT IS SLEEPING..."time.sleep(120)print"BOT IS AWAKE..."except:passdefrun_job(title):###To run the linked article version use 'RefHistoryFix2.py'os.spawnv(os.P_NOWAIT,"C:\Python25\python.exe",["python","RefHistoryFix.py "+'"'+title+'"'])oldCatTitle="Pages with incorrect ref formatting"bot=CategoryPages(oldCatTitle)bot.run()