Created
June 9, 2018 02:34
-
-
Save apple502j/83165cf2a37b092247331604b917dd6a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mw_api_client as mw | |
jawiki=mw.Wiki("https://ja.scratch-wiki.info/w/api.php","SW-ChangeLinks by apple502j: made of requests and mw-api-client") | |
jawiki.login("Apple_Bot","password_hidden") | |
x=input("The link to change >") | |
y=input("The new link >") | |
pg=jawiki.page(x) | |
works=pg.backlinks() # disable-english-lint uncountable-noun | |
for work in works: | |
d=work.read() | |
d.replace("[["+x,"[["+y) | |
work.edit(d,"Changed links to moved articles (BOT)") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment