Wikipedia:Bots/Requests for approval/EarwigBot 4


 * The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Symbol keep vote.svg Approved.

EarwigBot I
Operator: The Earwig  (Talk &#124; Contributions)

Automatic or Manually Assisted: Automatic, unsupervised

Programming Language(s): Python and Pywikipedia

Function Overview: The bot finds and removes all duplicate instances of the template WikiProject Russian History, per this BOTREQ.

Edit period(s): One time run

Already has a bot flag (Y/N): N

Function Details: This bot is in response to this bot request, brought up because of the recent merger between WikiProject Russian History and WikiProject Russia. This merger, accompanied by making the previously-used template WikiProject Russian History now redirect to WikiProject Russia, caused a large number of articles with both templates to have the same template twice. This bot's purpose, using a manually-compiled file, is to remove all instances of WikiProject Russian History unless the page doesn't have WikiProject Russia, in which case it does nothing. This is to avoid removing the WikiProject from the page altogether.

The bot functions by using a slightly-modified version of the replace.py (source) Pywikipedia module with the following regex:

$python RussianWikiprojectRemoval.py -file:RussianWikiprojectRemoval.txt -regex -nocase "" "" -excepttext:""

Thus, the bot will remove all instances of the template unless the other template is not there.

Discussion
Update: The bot's pages list has been compiled. View it here. The Earwig (Talk &#124; Contributions) 16:23, 9 May 2009 (UTC)
 * Shouldn't the regex be:  so that it isn't greedy? LegoKontribsTalkM 03:23, 10 May 2009 (UTC)
 * Shouldn't it also add the WikiProject Russia tag? Pages such as Talk:Okrug will be left without a template. X clamation point  03:33, 10 May 2009 (UTC)
 * Lego, nice catch there. X!, that's the whole point of this bot! Pages like Talk:Okrug will be skipped because they only have one template on them. The point of the bot is not to fix un-broken template transclusions, but rather to remove the double-instance of one template on the same page, such as with Talk:Khrushchev Thaw. The Earwig  (Talk &#124; Contributions) 03:43, 10 May 2009 (UTC)
 * Ah yes, I misread. X clamation point  03:48, 10 May 2009 (UTC)

About how many pages do we expect it to change? – Quadell (talk) 15:35, 10 May 2009 (UTC)
 * It's probably between 300 and 500. I can't get a specific estimate because I haven't finished compiling the list yet, but I'll have it pretty soon. The Earwig  (Talk &#124; Contributions) 16:28, 10 May 2009 (UTC)

Let's see her go. – Quadell (talk) 12:07, 11 May 2009 (UTC)
 * I'll have to run the bot tomorrow, the database lag is preventing the bot from running. It has to pause between edits for that huge number of seconds (built-in pywikipedia feature). Isn't that just wonderful? It keeps climbing, too! The Earwig  (Talk &#124; Contributions) 21:59, 11 May 2009 (UTC)
 * It's better now. Trial in progress. Standby as the results come in. See Special:Contributions/EarwigBot I for a live feed. The Earwig  (Talk &#124; Contributions) 00:47, 12 May 2009 (UTC)

This was a fast trial because it was fifty edits made in quick succession. My greatest apologies for forgetting to change replace.py's default edit summary. That will be fixed for the next trial/approval. The Earwig (Talk &#124; Contributions) 01:11, 12 May 2009 (UTC)

That was a pretty boring trial. Nothing to grouse about at all. :) – Quadell (talk) 01:20, 12 May 2009 (UTC)


 * The above discussion is preserved as an archive of the debate. Please do not modify it. Subsequent comments should be made in a new section.