Wikipedia:Bots/Requests for approval/RussBot 6
- The following discussion is an archived debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA. The result of the discussion was
Withdrawn by operator.
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:
- If there is only one parameter, and the disambiguation page (e.g., Buccaneer (disambiguation) in the example above) exists, the template will be replaced with
{{Other uses}}
, which will result in the text:For other uses, see Buccaneer (disambiguation) - If there are exactly two parameters; e.g.,
{{Redirect|Buccaneer|other things}}
, which would produce the text"Buccaneer" redirects here. For other things, see Buccaneer (disambiguation)and the disambiguation page exists, the template will be replaced with{{About| |other things}}
, which will produce the textFor other things, see Buccaneer (disambiguation). - If there are either one or two parameters and the disambiguation page does not exist, the template invocation will be deleted from the page. (Note: so far, I've only found two articles, out of 231 candidates, that would need a hatnote removed.)
- If there are three or more parameters, for example
{{Redirect|Buccaneer|other kinds of pirates|Pirate (disambiguation)}}
which would produce the text"Buccaneer" redirects here. For other kinds of pirates, see Pirate (disambiguation).the template invocation will be replaced with{{About| |other kinds of pirates|Pirate (disambiguation)}}
(with any parameters after the first being copied unchanged), resulting in the textFor other kinds of pirates, see Pirate (disambiguation).In this case, the bot will not test for the existence of any of the articles linked via the template.
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]
Discussion
[edit]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]
- {{for}} can be used instead of {{about}} with an empty first parameter. /~huesatlum/ 17:57, 9 June 2014 (UTC)[reply]
- That is true, for case [2] above, but it doesn't work for case [4] if there are more than two parameters after the page title. It seemed simpler to stick with {{About}} for both cases, rather than have to worry about divergences in the syntax. --R'n'B (call me Russ) 21:44, 9 June 2014 (UTC)[reply]
- After I wrote up the description above, another editor "helpfully" edited the article Buccaneer so that the erroneous hatnote is no longer present. Well, it is helpful for the encyclopedia, just not for comprehension of this request. :-) R'n'B (call me Russ) 21:48, 9 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:
- For Disco, see the modern style of music also called "disco". For Nu-disco, see Disco (disambiguation).
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:
- This article is about the music genre. For the entertainment venue, see discothèque. For the modern style of music also called "disco", see Nu-disco. For other uses, see Disco (disambiguation).
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]
- Thanks for the comments. I was able to fix the first bug, which was fairly trivial. But your second comment raises issues that aren't trivial at all. A surprising number of articles have more than one {{Redirect}} hatnote, and some may also have more than one {{About}} hatnote, not to mention hatnotes of other varieties. This is kind of taking me down the rabbit hole.... I'm going to have to rethink the whole script design to deal with some of these issues, so, for now --
Withdrawn by operator. R'n'B (call me Russ) 13:28, 12 June 2014 (UTC)[reply]
- The above discussion is preserved as an archive of the debate. Please do not modify it. To request review of this BRFA, please start a new section at WT:BRFA.