-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpurge.py
30 lines (25 loc) · 831 Bytes
/
purge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import time
from mwrogue.esports_client import EsportsClient
from mwcleric.auth_credentials import AuthCredentials
credentials = AuthCredentials(user_file="me")
site = EsportsClient('lol', credentials=credentials) # Set wiki
summary = 'Forcing blank edit' # Set summary
limit = -1
startat_page = None
print(startat_page)
startat_page = 'EShen'
this_template = site.client.pages['Template:Infobox Player'] # Set template
pages = this_template.embeddedin()
# pages = site.client.categories['Pages with script errors']
passed_startat = False if startat_page else True
lmt = 0
for page in pages:
if lmt == limit:
break
if startat_page and page.name == startat_page:
passed_startat = True
if not passed_startat:
print("Skipping page %s" % page.name)
continue
print('Purging page %s...' % page.name)
site.purge(page)