Wikipedia:Bots/Requests for approval/EarwigBot 4


EarwigBot 04

[[User:EarwigBot I|EarwigBot I]]

{{Newbot|EarwigBot I}}

Operator: The Earwig (Talk | 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 {{tl|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 {{tl|WikiProject Russian History}} now redirect to {{tl|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 {{tl|WikiProject Russian History}} unless the page doesn't have {{tl|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 ([http://svn.wikimedia.org/svnroot/pywikipedia/trunk/pywikipedia/replace.py source]) Pywikipedia module with the following regex:

$python RussianWikiprojectRemoval.py -file:RussianWikiprojectRemoval.txt -regex -nocase "{{WikiProject Russian (H|h)istory(.*)}}" "" -excepttext:"{{WikiProject Russia[^n]}}"

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 | Contributions) 16:23, 9 May 2009 (UTC)

:Shouldn't the regex be: "{{WikiProject Russian (H|h)istory(.*?)}}" so that it isn't greedy? LegoKontribsTalkM 03:23, 10 May 2009 (UTC)

::Shouldn't it also add the {{tl|WikiProject Russia}} tag? Pages such as Talk:Okrug will be left without a template. Xclamation 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 | Contributions) 03:43, 10 May 2009 (UTC)

::::Ah yes, I misread. Xclamation 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 | Contributions) 16:28, 10 May 2009 (UTC)

{{BotTrial|edits=50}} 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 | 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 | Contributions) 00:47, 12 May 2009 (UTC)

{{BotTrialComplete}} 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 | Contributions) 01:11, 12 May 2009 (UTC)

style="margin-left: 1em;; margin-bottom: 0.5em; width: 100%; border: #99B3FF solid 1px; background-color: #FFFFFF; color: #000000; float: right; "

|

{{BotApproved}} 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.