User:Misza13/Scripts/massblock.py
Appearance
< User:Misza13 | Scripts
import wikipedia, userlib def reblock(Site, address, AO, ACB, AB): User = userlib.User(Site,address) try: User.unblock('tweaking block settings') except userlib.BlockIDError: wikipedia.output(u'User was not blocked.') try: User.block(expiry='infinite',reason='{{tor}}',anonOnly=AO,noSignup=ACB,enableAutoblock=AB) except: wikipedia.output(u'Error blocking [[User:%s]]' % address) def main(): Site = wikipedia.getSite() lines = file('torlist.txt').readlines() for line in lines: reblock(Site,line[:-1],False,True,True) if __name__ == '__main__': try: main() finally: wikipedia.stopme()