| This page is documentation for Pywikipedia Compat, which is no longer supported.This page is kept for historical interest. It may document scripts and features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date. |
Now that you have installed python and Pywikibot, you need to get to a textual interface to your Operating System.
After you have created the file that is nameduser-config.py, you can access pywikibot.
OnWindows this is done by opening the start menu, and clicking on 'Run'. You are asked to give the name of a program, type "cmd.exe".
chdir C:\The following steps might need to be done:
OnMac, find Terminal.app in /Applications/Utilities, seeMac Installation.
OnLinux or any otherUnix, use any terminal application such as gnome-terminal, konsole, xterm, or simply the text-mode console.
In compat, run the scriptlogin.py by typing "python login.py". If you don't haveuser-config.py yet, this command will interactively create it.
In core, from the core directory, run the scriptlogin.py by typing "python pwb.py login". If you don't haveuser-config.py yet, this command will interactively create it.
Python will then return:
Password for user your_bot on your_site:en:
Use the password you used for the bot's login name. Note that your input will not be visible for privacy reasons. The bot can't work anonymously. Unless you change your password, you normally need to run this program only once, the bot usually does not get logged off.
The bots are in the main pywikibot folder when downloaded.
If necessary, use the command cd to go to the directory where the bot files are saved.
Now run any of the bots here by typing "python botname.py" (If you are using Windows, you can leave out "python").
Although many bot scripts have their own command line arguments, which should be documented on their respective pages (or in their source code), all bots unless specifically stated to the contrary recognize the following command line arguments:
(full list here:Manual:Pywikibot/Global Options)
xx, overriding the configuration inuser-config.py.user-config.py.xyz as the filename.For example,python scriptname.py -family:wiktionary will run the "scriptname" bot on wiktionary articles, overriding the default family setting in your user configuration.
Make sure that your bot is approved by the wiki community where you are going to use it: see theglobal Bot policy for guidance. Strictness differs greatly between various projects.
Using your normal browser, create a login name and password for the bot. It is best to use a name that makes clear that it is a bot, and preferably also who is operating it. A common method is to use your own login name and add the word 'bot' to it, but several other forms also exist.