Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F25598302
Clean vandal created pages
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Framawiki
Sep 1 2018, 8:36 PM
2018-09-01 20:36:02 (UTC+0)
Size
959 B
Referenced Files
None
Subscribers
None
Clean vandal created pages
View Options
# -*- coding: utf-8 -*-
"""
Quick script that allows to easily block vandals and delete pages
"""
from __future__ import absolute_import, unicode_literals
import pywikibot
from pywikibot import pagegenerators
genFactory = pagegenerators.GeneratorFactory()
genFactory.handleArg('-start:!')
genFactory.handleArg('-ns:3')
genFactory.handleArg('-family:anekdotos')
gen = genFactory.getCombinedGenerator(None)
preloadingGen = pagegenerators.PreloadingGenerator(gen)
for i in preloadingGen:
pywikibot.output('\n\n== %s ==' % i.title())
t = i.text
if len(t) > 300:
pywikibot.output(t[:300])
else:
pywikibot.output(i.text)
choice = pywikibot.input_choice('Do you want to delete this user?',
[('Yes', 'y'), ('No', 'n')], 'n', automatic_quit=False)
if choice == 'y':
i.delete('spam', prompt=False)
user = pywikibot.User(pywikibot.Site('fr', 'anekdotos'), i.title(withNamespace=False))
if not user.isBlocked():
user.block('infinite', 'spam')
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6358203
Default Alt Text
Clean vandal created pages (959 B)
Attached To
Mode
P7507 Clean vandal created pages
Attached
Detach File
Event Timeline
Log In to Comment