Help:Bots

From FORwiki

Revision as of 10:55, 14 October 2009 by Admin (Talk | contribs)
Jump to: navigation, search

Template:RobotWarning

Two robots are available and freely useable on the English Wikisource, ThomasBot and YannBot. These bots follow regex requests placed on their talk pages; this page explains the request syntax.

Contents

Making a request

Requests must be made using the {{Requete}} (French for 'request') template. The general syntax is {{Requete|edit summary|destination|command|parameters}}. You can make several requests simultaneously, but the bot will do one at a time. Thus, there should only be one Template:RequeteEnCours on the page at any one time, unless you make a mistake. The bot updates the template to show the status of the request:

If the bot does not respond, it is probably not enabled. To find out if it is currently enabled, see whether it is in the IRC channel #en.wikisource (Wikimedia). Alternately, it may simply be busy with another request, as it is used on several wikis. If that is the case, be patient.

Syntax

Edit summary

The 'edit summary' field is the edit summary used by the bot. Please note your name (without a pipe '|' symbol) in this field as well. For example, "removed category (request by ThomasV)".

Destination

The 'destination' field tells the bot which pages to edit. There are three types of destinations you can specify:

  • A single page: [[page name]]
  • All pages linked from one page: links:[[page name]]
  • All pages in a category: [[:Category:category name]]

Notes:

  • The commands NAVIGATEUR, SPLIT, and IMPORT will only work if a single page is specified.
  • The bot will ignore any page outside the articlespace.

Command

The 'command' field tells the bot what to do. Certain symbols must be escaped:

Symbol Escape as
| \|
[] \[\]
{} \{\}

When using these symbols literally in regular expressions, they need to be double-escaped: \\[\\], \\{\\}, and \\|. In regex and replace commands, \L is replaced by the name of the link that was followed to access the page.

DELETE

Removes a given string from the page: {{Requete|edit summary|pages|DELETE|string to delete|}}.

REPLACE

Replaces a given string: {{Requete|edit summary|pages|REPLACE|string to replace|string to replace with}}.

REGEXP

Replaces a given regex pattern (python re.sub syntax): {{Requete|edit summary|pages|REGEXP|pattern|remplacement}}.

TEXT, TEXTE

Put the content of a page in <div class=text>, unless the class already exists in the page:

{{Requete|edit summary|pages|TEXT}}.

NAVIGATEUR

Adds a navigation template to subpages of a given page: {{Requete|edit summary|page|NAVIGATEUR}}.

Note that after using this function, it may be necessary to make a DELETE request to eliminate redundant strings separating the title and the chapter number (for example, " - ").

SPLIT

Splits a page into subpages from second-level sections (== foo ==). How it names pages depends on the syntax:

syntax Naming
{{Requete|edit summary|page|SPLIT}} work title + name of sections
{{Requete|edit summary|page|SPLIT| }} work title + number (add a space as last parameter)
{{Requete|edit summary|page|SPLIT|name of divisions}} work title + "name of divisions" (ie, 'Chapter') + number
{{Requete|edit summary|page|SPLIT|NOPREFIX}} name of sections only (not subpages)

Notes:

  • If the request has no results, it's probably because the page is split into third-level sections (=== foo ===) instead of second-level sections (== foo ==).
  • The last parameter (for example, "chapter") is optional. If it is omitted, the bot will use the section names to create the subpage names. If it is not omitted, the subpages are created based on it plus a number (ie, "Chapter 3"). If NOPREFIX is used, the bot creates the pages in their own name (not as subpages).
  • If a target page already exists, the bot will check whether it is the same as the content to split. If so, it skips the section; otherwise, it creates a new page with the same name followed by a number.
  • Sometimes page creation will fail, for example if the servers return an error. This will lead to redlinks on the main page; if this is the case, you can revert the changes to the main page and resubmit the SPLIT request. You should not change any of the subpages, otherwise the bot will create duplicates (see point above).
  • The bot will not create pages if the sections to split are empty, but will add a redlink to the main page.
Personal tools