From Marshals Guide
Jump to navigation Jump to search

A bot is a computer program that automatically retrieves or updates wiki pages when it is executed. In general, bots are used for repetitive maintenance tasks, whose volume and characteristics are too large to be performed manually by users.

Developing and executing bots is normally outside the role of normal users, requires programming experience and must be done in coordination with the wiki's admins.

By default, bot edits are hidden in Special:Recent changes.

Framework and interface for bot development

Bots do not access the wiki through the normal graphical user interface. MediaWiki has an API (Application Programming Interface) available for this purpose. An API is a protocol for standardised communication between two computer programs. Check {{ #ifeq:

 Marshals Guide

| MediaWiki | API:Client code | [[{{#if:|{{#ifexist:API:Client code||mw:}}}}API:Client code|API:Client code]] }} for more information.

To access a wiki through the API a bot must have a user account, which has been granted 'bot' permissions.


{{ #ifeq:

 Marshals Guide

| MediaWiki | Manual:pywikipediabot | [[{{#if:|{{#ifexist:Manual:pywikipediabot||mw:}}}}Manual:pywikipediabot|Manual:pywikipediabot]] }} provides a framework for the development of bots, which are commonly used to perform maintenance tasks such as adding a footer to some categorized pages (, adding some wikilinks ({{ #ifeq:

 Marshals Guide

| MediaWiki | | [[{{#if:|{{#ifexist:Manual:pywikipediabot/||mw:}}}}Manual:pywikipediabot/|]] }}), moving old contents of talk pages to subpages ({{ #ifeq:

 Marshals Guide

| MediaWiki | | [[{{#if:|{{#ifexist:Manual:pywikipediabot/||mw:}}}}Manual:pywikipediabot/|]] }}), editing categories ({{ #ifeq:

 Marshals Guide

| MediaWiki | | [[{{#if:|{{#ifexist:Manual:pywikipediabot/||mw:}}}}Manual:pywikipediabot/|]] }}), or managing templates ({{ #ifeq:

 Marshals Guide

| MediaWiki | | [[{{#if:|{{#ifexist:Manual:pywikipediabot/||mw:}}}}Manual:pywikipediabot/|]] }}).

Extension alternatives

  • Extension:MassEditRegex provides an alternative way to perform mass edits using regular expressions, through a special page in the wiki. Only admins can normally use this extension.

See also

  • {{ #ifeq:
 Marshals Guide

| MediaWiki | meta:Bot | [[{{#if:|{{#ifexist:meta:Bot||mw:}}}}meta:Bot|meta:Bot]] }}