Created
December 5, 2010 04:38
-
-
Save vssun/728802 to your computer and use it in GitHub Desktop.
Create list of deleted files "pagelist.txt" from deletion log
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
നീക്കം ചെയ്ത പ്രമാണങ്ങളുടെ പട്ടിക നിർമ്മിക്കാനുള്ള സ്ക്രിപ്റ്റ് | |
നിർമ്മിച്ചത്: സുനിൽ വി.എസ്. | |
തിയതി: 2010-11-27 | |
""" | |
import wikipedia | |
import pagegenerators | |
import unicodedata | |
import codecs | |
import re | |
import pywikibot | |
#main program starts here | |
siteFamily = 'wikipedia' | |
siteLangCode = 'ml' | |
wikiSite = wikipedia.Site(code=siteLangCode, fam=siteFamily) | |
log = codecs.open('logs/remove-deleted-images.log', mode='at', encoding = 'utf-8') | |
myPageList = ur"" | |
for myImage in pagegenerators.LogpagesPageGenerator(number=100000,mode='delete'): | |
if myImage.title()[:8]==ur'പ്രമാണം:': | |
wikipedia.output(myImage.title()) | |
myPageList +=myImage.title()+'\n' | |
pageListFile = codecs.open('pagelist.txt', mode='at', encoding = 'utf-8') | |
pageListFile.write(myPageList); | |
pageListFile.flush() | |
pageListFile.close() | |
wikipedia.stopme() | |
log.flush() | |
log.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment