Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
E.zn | de10e560c3 | 5 years ago |
E.zn | db70055d72 | 5 years ago |
Castro0o | 9a119676f1 | 5 years ago |
File diff suppressed because one or more lines are too long
@ -0,0 +1,25 @@
|
|||||||
|
import os, argparse, sys, re, json
|
||||||
|
from mwclient import (Site,
|
||||||
|
errors)
|
||||||
|
|
||||||
|
# API CALL
|
||||||
|
# https://hub.xpub.nl/sandbox/itchwiki/api.php?action=smwbrowse&browse=pvalue¶ms={ "limit": 1500, "offset": 0, "property" : "Creator", "search": "" }&format=json
|
||||||
|
# generated orgs.json
|
||||||
|
|
||||||
|
# login
|
||||||
|
site = Site(host='hub.xpub.nl/sandbox', path='/itchwiki/')
|
||||||
|
|
||||||
|
wd =os.path.dirname(os.path.abspath(__file__)) # parent working directory
|
||||||
|
with open(os.path.join(wd, 'login.txt'), 'r') as login: # read login user & pwd
|
||||||
|
loginlines = login.read()
|
||||||
|
user, pwd = loginlines.split('\n')
|
||||||
|
site.login(username=user, password=pwd) # login to wiki
|
||||||
|
|
||||||
|
|
||||||
|
with open('creators.json', 'r') as f:
|
||||||
|
creators = json.load(f)
|
||||||
|
|
||||||
|
for pagename in creators['query']:
|
||||||
|
page = site.pages[pagename]
|
||||||
|
print(pagename)
|
||||||
|
page.save(page.text() + '\n[[Category:Creator]]')
|
Loading…
Reference in New Issue