Operator: R'n'B (talk · contribs · SUL · edit count · logs · page moves · block log · rights log · ANI search)
Time filed: 18:57, Wednesday May 21, 2014 (UTC)
Automatic, Supervised, or Manual: Automatic
Programming language(s): Python, using Pywikibot framework.
Source code available: Will be on Labs, once finalized.
Function overview: Fix self-referential ((Redirect)) template invocations.
Links to relevant discussions (where appropriate):
Edit period(s): Monthly, or as needed.
Estimated number of pages affected: About two hundred on the first run, due to backlog, and likely in the low tens per month after that.
Exclusion compliant (Yes/No): Yes
Already has a bot flag (Yes/No): Yes
Function details: ((Redirect)) is a hatnote template designed for articles that are the target of a potentially ambiguous redirect. For an example of correct template usage, see Augustus, which contains((Redirect|Octavius))
, producing the text ((Redirect|Buccaneer))
, producing the text This bot task will look for articles that contain the template ((Redirect)) with the article's own title as the first parameter. These articles will be edited as follows:
((Other uses))
, which will result in the text: ((Redirect|Buccaneer|other things))
, which would produce the text ((About| |other things))
, which will produce the text ((Redirect|Buccaneer|other kinds of pirates|Pirate (disambiguation)))
which would produce the text ((About| |other kinds of pirates|Pirate (disambiguation)))
(with any parameters after the first being copied unchanged), resulting in the text I have done a "dry run" of the script that just output a diff of the edit that the script would make, but did not make any actual edits to articles. The output of the dry run can be viewed at User:RussBot/Test - recursive redirect hatnote task. R'n'B (call me Russ) 17:12, 29 May 2014 (UTC)[reply]
I would just like to weigh in to support this proposed bot task. Hatnotes that suggest a page redirects to itself are a particularly silly error, and one that can be easily fixed by a bot. bd2412 T 14:03, 3 June 2014 (UTC)[reply]
I looked at the dry run – well, the first edit, at least. It's to disco, and seems problematic. First, it replaces the hatnote with ((About| |Disco|the modern style of music also called "disco"|Nu-disco))
, which looks like a bug:
It seems like you meant to replace it with ((About| |the modern style of music also called "disco"|Nu-disco))
based on #4 above, but this apparently didn't work, so you should fix that first. Additionally, I have a problem with the bot changing ((about)) followed by ((redirect)) into two ((about))s on the same page. It should be possible to detect this situation and instead integrate the parameters into one ((about)) template. Since disco has ((About|the music genre|the entertainment venue|discothèque|other uses))
at the top, I would expect the bot to replace it with ((About|the music genre|the entertainment venue|discothèque|the modern style of music also called "disco"|Nu-disco|other uses))
, which looks like:
While your solution is still an improvement over the original, I would expect the bot to go a step further in this case since the logic involved isn't too difficult. — Earwig talk 23:28, 10 June 2014 (UTC)[reply]
Withdrawn by operator. R'n'B (call me Russ) 13:28, 12 June 2014 (UTC)[reply]