SHARE
TWEET

Untitled

a guest Apr 1st, 2008 33 Never
  1. import sys, socket, operator, os, codecs, wikipedia, urllib, gc, re, family, time
  2. site = wikipedia.getSite()
  3. evilcontribs = '/w/index.php?title=Special:Contributions&limit=3000&contribs=user&target=AkhtaBot'
  4.  
  5. def main():
  6.   regexp = re.compile('<span class="mw-rollback-link">(?P<url>.+?)" title="', re.UNICODE)
  7.   html = site.getUrl(evilcontribs)
  8.   for m in regexp.finditer(html):
  9.     try:
  10.       url = wikipedia.html2unicode(m.group('url')).replace('[<a href="', '')
  11.       print time.strftime('[%H:%M:%S] Rolling back an edit...')
  12.       temp = site.getUrl(url)
  13.     except:
  14.       print sys.exc_info()[0]
  15.       print sys.exc_info()[1]
  16.  
  17. if __name__ == "__main__":
  18.   try:
  19.     main()
  20.   finally:
  21.     wikipedia.stopme()
RAW Paste Data
Top