-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpfautoedit.py
54 lines (46 loc) · 1.13 KB
/
pfautoedit.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from mwcleric.auth_credentials import AuthCredentials
from mwrogue.esports_client import EsportsClient
limit = -1
# startat_page = 'Gamelord'
template = 'Infobox Player'
form = 'Infobox Player'
credentials = AuthCredentials(user_file="bot")
site = EsportsClient('fortnite-esports', credentials=credentials) # Set wiki
########################################
result = site.pages_using(template, generator=False)
# pages = []
for p in result:
# pages.append(p)
site.client.api('pfautoedit', format='json',
form=form,
target=p
)
# try:
# startat = pages.index(startat_page)
# except NameError as e:
# startat = -1
# except ValueError as e:
# startat = -1
# failures = []
#
# lmt = 0
# for page in pages:
# if lmt == limit:
# break
# lmt += 1
# print(page)
# if lmt <= startat:
# pass
# else:
# try:
# print(page.name)
# site.client.api('pfautoedit', format='json',
# form=form,
# target=page
# )
# except Exception as e:
# failures.append(page + "(" + e.args[0] + ")")
# print('Done! Printing failures...')
#
# for failure in failures:
# print(failure)