Planning the future of Botwiki! - Help us bring Botwiki up to date, contribute to our strategy discussion, add bot scripts, and contribute manuals, guides, and tutorials! Almost anything related to bots, particularly those used to edit mediawiki, is welcome.
UNABLE TO EDIT? - We've experienced attacks by spambots lately and now require you to confirm your e-mail before you can edit (go to your preferences, enter an e-mail address, and request a confirmation e-mail, then go to your e-mail and click on the confirmation link). We also require new accounts to make a few edits and wait a few minutes before before you can create a page; however, if this is a problem contact us in #botwiki and we can manually confirm your account. Sorry for the inconvenience.
Manual:Bot
- For general information on bots see: Wikipedia:Bots
- For general information on the creation of bots see: Wikipedia:Creating a bot
- For our quick start guide for the Python Wikipedia Bot, see Manual:Speed guide for pywikipediabot
Contents |
What you need
To have a bot you need two things:
- A name for your bot
- A bot script
What you don't need
You don't need to have approval to have a bot, you need approval on some projects to edit outside of your own user space with a bot and on others merely to edit at "bot speed" (generally editing below 30-60 seconds per edit, depending on the project). Even on the English Wikipedia, an unapproved bot may edit in its own and its operator's userspace and may make limited edits to the Sandbox and other test pages (see WP:BOTAPPROVAL). On this project you do not need approval at all and you do not need a bot flag. If you mess something up we'll tell you and we'll expect you to fix it. We do ask that if you are not experienced, you start with just a few edits to see if your script is working. If you need to run a large scale test, you'll probably need to create the pages to test on with another bot script. In this case, please ask us in advance for a bot flag. Bot flags on this project are generally reserved for bots that are doing large scale testing and bots that actually work on the maintenance of this project.
Your bot, just like a human account, will need to have a confirmed e-mail address to edit and will need to be autoconfirmed (or you can request to be confirmed early) to move pages, create pages, etc.
Bot flag
A "bot flag" is a permission setting identifying an account as a bot. The bot flag is not required to run a bot on most projects. The bot flag is also not a direct benefit to the bot on most projects. Nor is it a badge or special permission. It is a benefit to the community; it prevents a bot making thousands of edits per hour from flooding the RecentChanges feed and making it difficult for other users to see anything else; like changes to pages they are interested in or vandalism. Edits by accounts with the bot flag will not show in the Recent Changes feed by default. They can be shown if you want to see them[1]. Additionally, on some projects, bots have additional rights like the ability to move pages without creating redirects or to write to the API that ordinary users do not commonly have.
The bot name
Your bot needs to have an account in its own name for its exclusive use. You should not make bot edits through your "human" account, although in some cases it is acceptable to use a program or script to make repetitive edits through your human account, you should never do so in an automated manner or at a very high rate of speed. Although this rule may not be strictly enforced on all projects it is a standard rule on all Wikimedia Foundation projects and violating the bot rule may get you blocked even if your edits are not vandalism or otherwise damaging.
Frequently there are rules about the naming of such accounts. The most common rule is the name must include the word "bot" (many projects also prohibit "human" accounts from using the word "bot" in their names). Another frequent rule is that the name must include a reference to, or a portion of, your personal ("human") account name. Examples are: User:DougBot belongs to User:Doug, User:Miszabot belongs to User:Misza13, etc. These rules are not strictly enforced on Botwiki and some Wikimedia Foundation projects are stricter than others. Additionally, many WMF projects grandfather older accounts but will hold new bot accounts strictly to these rules. Although your account name on botwiki need not be the same as your name on WMF projects, you will have a unified account on WMF projects and should follow the strictest rule of any project that you intend to edit on. For this reason it is recommended that you choose a name that includes a recognizable portion of your human account name appended with the word "bot". If your name is User:SheIsAWitch, choose a name like User:SheIsAWitchBot, User:Witch-bot, User:SIAWbot, or User:HeavierThanABot for an account name for your bot. If you have any questions, ask an experienced user before you register your account.
You do not need permission to register a bot account. You can do that now. But you should not make edits outside your userspace or the bot's userspace with your bot account until you have complied with all local rules and tested your scripts.
The bot scripts
There are various forms of bot scripts, by "scripts", we mean anything from a couple dozen lines of PHP or Python, or even a shell script such as bash, to an entire python program with many optional modules that can accomplish many different functions, such as Pywikipediabot, to the semi-bot program Auto-Wiki Browser (AWB), written in C Sharp. Programs like AWB can be used through human accounts to assist with repetitive edits or can be used in an automatic mode as a sort of turn-key bot. Because a bot is generally approved for a limited set of functions, the use of other scripts, even scripts that are part of the same program or framework, may be considered the operation of an unapproved bot. In some cases, different scripts may be referred to by some users as separate bots and it is possible (though in many cases not allowed) to run multiple scripts or even multiple programs over the same bot account simultaneously. This can cause some semantic confusion and get one in trouble. Therefore it is be clear when speaking of a "bot" whether you mean a "bot account" or a "bot script" and, although it is not necessary to limit a bot account to a single script, it is best to only run scripts for which the bot account has been approved and to stick to a single framework or program. In other words, if you have an account approved to move pages and add categories using the pywikipediabot framework, then you can normally run movepages.py and category.py on the same account - even though you may hear people refer to the movepages.py bot and the category.py bot, they simply mean "bot script". If you want to run scripts that you did not originally have approval for, you normally need only post notice or, on some of the more formal projects, request additional approvals for your existing bot account. However, if you want to run an AWB bot and a Python Wikipedia Bot, and you are experimenting with a new automated php script, you should have at least three bot accounts.
AWB
AutoWikiBrowser (often abbreviated AWB) is a semi-automated MediaWiki editor for Microsoft Windows 2000/XP/Vista/7, designed to make tedious repetitive tasks quicker and easier. It is essentially a browser that automatically opens up a new page when the last is saved, suggest changes based on the instructions it is provided, and if set to do so, makes the changes automatically. It is this last function which makes AWB a bot program.
While very easy to run, it is of course, less easy to customize, particularly for the beginner. AWB primarily relies on search and replace functions and regular expression instructions. Additionally, it has good support for adding templates and generating lists of pages to edit from categories, links, etc. It can be customized with plugins.
As AWB is not primarily a bot program, and as there is thorough documentation for use of the AWB on WMF projects and it requires little to no programming skill, merely an understanding of regex to obtain its full functionality, it will not be dealt with in detail on this project. Detailed information on AWB is at Wikipedia:AutoWikiBrowser.
Python Wikipedia Bot
The Python Wikipedia Robot Framework, or Pywikipediabot, is a highly popular collection of many scripts written in the Python programming language. While the bot can be run with little programming knowledge, a basic knowledge of python and a good understanding of the Python regex flavor are helpful to getting the bot to perform as desired and properly controlling the bot. The bot has many complex scripts that it relies on and when a problem is encountered it may represent an error in the instructions from the bot operator or a bug in one of the scripts, possibly caused by changes to the media wiki software. The bot operator is expected to be able to fix the problem or to immediately stop running the bot until it is fixed.
Botwiki was originally created as a place to develop pywikipediabot scripts and has additional information on pywikipediabot here.
The official documentation for pywikipediabot is available at MediaWiki.org.
Other bot scripts
There are a other tested bot scripts, some of which are available here. Use these with caution as they may have been written several years ago for a previous version of mediawiki or they may never have been fully tested. Also, there are snippets here and there from which you can create your own scripts. Other than python, the most popular bot languages are php and perl; however, there are no maintained bot frameworks in those languages. Bots in languages that require pre-compiling are unusual, other than AWB, mentioned above, but are not out of the question.