How to Use these Scripts

These are some helpful scripts written for Pywikibot or for the Bash shell.

To run the .py bot scripts, first install Pywikibot.  Then 'cd' into the core/ directory and run the command "python pwb.py /path/to/script [arguments for script]".  When running a built-in Pywikibot script, you would simply invoke it with "python pwb.py [name of script without suffix] [arguments]", but since these scripts are outside the core/ directory they need full pathname qualification.

check_interwiki_links.py
This Python script scans the wikitext of the supplied page, or all the pages in the supplied category, for interwiki links such as [[wp:Example]] and [[wikt:Definition|some word]].  It then tests those links to make sure they're valid and prints a "WARNING:" message if a redirect or 404 is encountered.

Example usage:
python pwb.py check_interwiki_links -page:"Daodan" (checks a single page)
python pwb.py check_interwiki_links -cat:"Wiki Support" (checks the whole category recursively)

check_intrawiki_section_links.py
This Python script scans the wikitext of the supplied page, or all the pages in the supplied category, for intrawiki links with section links in them such as [[Konoko#In-game_appearance]].  It then tests those links to make sure they're valid and prints a "WARNING:" or "ERROR:" message if a problem is encountered.  "ADVICE:" messages are printed when a link cannot be tested because transclusion is being used to construct it.

Example usage: the syntax is the same as for check_interwiki_links.py, so see its usage above.

find_external_images.py
This Python script scrapes the HTML of the supplied category of pages and alerts the user to external images so he can consider localizing them to the wiki.  Special attention is drawn to images hosted elsewhere on oni2.net.  This script isn't totally finished and the argument-handling code is in a bit of disarray, but in theory it supports optionally showing inline and/or non-embedded external image links, as well as accepting an individual page as an argument.

Example usage:
python pwb.py find_external_images -justshown -cat:"Category:Real World"

drive_https_upgrade.sh
This Bash script was designed to take a TXT report from a Validate External Links session run without the --show-https-upgrades argument and use it to mass-change all the links that wanted an upgrade from HTTP to HTTPS.  In such a report, links that wanted an HTTPS upgrade would have the phrase "http->https" in it, so this is what the script uses regex to search for.  It edits all such links from the one numbered FIX_START to the one numbered FIX_END.  This script served its purpose and probably won't need to be used again, but it has value as a tutorial.

drive_slash_adding.sh
Ditto what I wrote above, except for a ValExtLinks session run without the --show-added-slashes argument.  In this case the word "trailing", as in "trailing slash", is looked for.  Probably won't need to use this again, but it has some instructional value.