User:Inductiveload/InductiveBot information

From Wikisource
Jump to: navigation, search

InductiveBot is based on pywikipedia, and a few scripts that run over pywikipedia, performing more complex edits that cannot be done simply with the out-of-box scripts.

Generally I call my scripts "aa-xxxxx.py", so they float to the top of list of files. Text input files I call "ab-xxxx.txt".

Custom scripts[edit]

Handler scripts[edit]

One class of script I have found to be very useful is the "handler script" which is a script which calls a pywikipedia script in turn. This means that for common operations, you don't have to type in a complex command line argument list, just load up the script from last time, change relevant parameters and away you go.

A useful pair of functions for Page: namespace[edit]

The following functions decompose a page in the Page: namespace consisting of a header, body, and footer, and then recompose them neatly after modification. The noincludes around the header and footer must be well formed, or the Javascript that presents them in the edit page with break.