Created
March 11, 2018 10:20
-
-
Save apple502j/af7fa17741e770aa8f747acea78c0a2f to your computer and use it in GitHub Desktop.
Clean Your Sandbox (MW bot) need kenny2github/mw-api-client
This file contains hidden or 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
# This code is in the public domain. | |
import mw_api_client as mw | |
from getpass import getpass | |
API_PATH="" # API URL like https://en.wikipedia.org/w/api.php | |
USERAGENT="Sandbox Cleaner with mw_api_client" # User-Agent | |
USERNAME="" # User name | |
SANDBOXPATH="" # Sandbox path | |
DEFAULT_SANDBOX="" # Default Sandbox contents | |
SUMMARY="Clean Sandbox (via cleansandbox.py)" | |
wiki=mw.Wiki(API_PATH,USERAGENT) | |
wiki.login(USERNAME,getpass("Password for {0} >".format(USERNAME))) | |
sandbox=wiki.page(SANDBOXPATH) | |
sandbox.edit(DEFAULT_SANDBOX,SUMMARY) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment