|License||CC BY-SA 4.0|
|Automatic translations||Deutsch, Español, Français, Português, Italiano, Kiswahili|
|Cite as "Appropedia:Pywikipediabot". Appropedia. 2021. Retrieved 2021-06-19.|
Notes on using the Pywikipediabot (or Pywikipedia) specifically for Appropedia can be placed here.
Note that Chriswaterguy is using this bot, so after you've set up, or if you follow the instructions and have problems, you can contact him.
Set up[edit source]
Follow the instructions linked above to install Pywikipediabot. Then, you need to create the following files in the appropriate places:
Get the site dump[edit source]
Using the bot works best if you have a recent copy of the "current dump".
Decompress the dump file, currentdump.xml into the bot's root directory, and use the term -xml:currentdump.xml in your bot command. This works in the replace.py script, and several others. (Alternative parameters are -category:'category name' and -start:pagename - avoid start except where doing a few pages all starting with the same string, as it requires downloading each page on the wiki.)
Running the bot[edit source]
redirect.py is relatively easy, and is a good one to start on.
More information can be found at meta:Pywikipedia, but is incomplete and confusing at present.
Help can be found on Pywikipedia-L - IRC is available (#Pywikipedia on freenode) but very quiet, so it's more useful to stick to the lists.
Sample usage[edit source]
python replace.py -namespace:2 -start:User:Tahnok
This will search through namespace #2 (which is User:). You can change it to a different one by looking it up. You can also specify multiple namespaces with -namespace:2,3.
The -start:PAGENAME indicates where the bot should start. It isn't needed, and a different source should be specified if intending to search all pages in the namespace(s).
As noted above, -xml:currentdump.xml is much more efficient, unless you need a more recent version than is available as a dump, and you are doing a small number of pages (e.g. up to 100 or so) rather than searching a whole namespace. Other options include -cat, -xmlstart, -prefixindex and -titleregex. See meta:Pywikipediabot/replace.py#Local for details.
python redirect.py double
This suggests double redirects to fix.
python redirect.py double -always
This fixes double redirects without asking. This is safe to run regularly on the live site. Check to see that the output makes sense (pages aren't being redirected to other pages that don't make sense). In the unlikely event that there is a problem, go to the wiki and manually revert the particular move.
See also[edit source]
- Appropedia:Bot tasks
- Appropedia:Wikilink bot
- Appropedia:Pywikipedia bot/notes commands & tweaks, what works & what doesn't.