Wikipedia:Bots/Requests for approval/SporkBot 5


 * 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 Symbol keep vote.svg Approved

SporkBot 5
Operator:

Time filed: 22:43, Saturday November 15, 2014 (UTC)

Automatic, Supervised, or Manual: Automatic after a period of supervision.

Programming language(s): Perl using the MediaWiki::Bot library

Source code available: Will be made available upon approval

Function overview: Assist with removing some entries from Category:Pages using duplicate arguments in template calls.

Links to relevant discussions (where appropriate): Category talk:Pages using duplicate arguments in template calls and probably elsewhere.

Edit period(s): Weekly after a one time run

Estimated number of pages affected: Around 70,000 to 100,000 will be initially scanned, but fewer will be affected.

Exclusion compliant (Yes/No): Yes, assuming the MediaWiki::Bot library is bots compliant. If not, I will make it so.

Already has a bot flag (Yes/No): Yes

Function details: The bot will fix two very simple cases of duplicate parameters, (1) Replacing  with   and (2) Replacing   with. These are the only two cases which have been identified as easy for a bot to fix. An unscientific random sample of the category has identified that about 25 percent of the entries fall in these two classes. If other non-controversial cases are identified, then more discussion will ensue to make sure there is consensus for having the bot fix more. Thanks!

Discussion
As discussed on the Category Talk page, the bot should also replace  (identical parameters, both empty) with. – Jonesey95 (talk) 23:14, 15 November 2014 (UTC)
 * Yes, that's case (1) and case (2). Plastikspork ―Œ (talk) 23:34, 15 November 2014 (UTC)


 * How will the bot deal with whitespace and HTML comments? I think that named arguments with whitespace/HTML comments should be treated as equal to blank arguments, as it doesn't make any difference to the template output. However, more care will need to be taken with mixed named/positional parameters, e.g., as the two arguments have different whitespace output. Also, would the bot treat   as equal to  ? I think it should, as if I remember correctly the MediaWiki parser strips all whitespace and HTML comments from named template arguments. — Mr. Stradivarius  ♪ talk ♪ 13:27, 16 November 2014 (UTC)
 * Mr. Stradivarius, the current code is very cautious in that it would replace  with , but would not do anything to  , nor would it do anything to  .  It also is not, yet, coded to do anything to  .  I could add this case, but for the first pass, I plan to stay away from those.  However, we should consider adding that case later since I have seen quite a few   in my initial non-scientific random search.  Note that, the code will generate a summary of the action taken on each page, which I can/will upload for anyone to review in case there are any problems, or if someone wants to re-fix any cases by hand. Thanks! Plastikspork ―Œ (talk)  21:24, 16 November 2014 (UTC)
 * That sounds like a good plan. If there turn out to be a lot of template calls that look like  or   then we can always take a look at them after the bot has done its first run. This issue may only be theoretical, though, as I don't remember coming across any comments like this when looking at actual pages in Category:Pages using duplicate arguments in template calls. And by the way, thank you for taking this on! This will be a big help in clearing out the category. — Mr. Stradivarius  ♪ talk ♪ 23:31, 16 November 2014 (UTC)

In case it is not clear to an admin reviewing this BRFA, the changes made by this bot would remove articles from the error category listed above. It would not change the appearance of any articles, since where there are two occurrences of the same parameter in a template, the value of the first parameter is ignored when the template is rendered. The bot will clean out the low-hanging fruit from the error category, leaving the trickier cases for human editors to address. – Jonesey95 (talk) 21:43, 16 November 2014 (UTC)

Another thought - the bot probably shouldn't replace  with , as fairly often the error is in the parameter name, rather than the value. User:Redrose64 explains more in this post. Replacing  with   should be no problem. — Mr. Stradivarius  ♪ talk ♪ 01:48, 17 November 2014 (UTC)
 * Here's an example of such an error that I fixed today. — Mr. Stradivarius  ♪ talk ♪ 02:48, 17 November 2014 (UTC)
 * fixing those seems fine with me, assuming Plastikspork will post a log of the changes, someone can easily review those and go back and fix them properly, looking for a pattern like repeated numeric values or the score keyword (for example). Frietjes (talk) 15:05, 17 November 2014 (UTC)
 * That would work in theory, but in practice if there are a lot of such template invocations that need to be checked - say more than 1000 - it will take a significant amount of time to go through and check them all. And for this kind of mistake, the original invocation will be easier to fix than the invocation with duplicates removed. How about putting together a blacklist of templates that are likely to have errors like this? That would include all sports score templates, and maybe others too. — Mr. Stradivarius  ♪ talk ♪ 22:03, 17 November 2014 (UTC)
 * Mr. Stradivarius, or just just having any parameter that matches the pattern  (e.g.,  ) exempted from the first run? Frietjes (talk) 22:06, 17 November 2014 (UTC)
 * That would probably do the job, yes. I'll keep an eye out for other potential problem templates as well. — Mr. Stradivarius  ♪ talk ♪ 23:18, 17 November 2014 (UTC)
 * Sure, we can do that, no problem. Thanks! Plastikspork ―Œ (talk)  02:38, 18 November 2014 (UTC)

- Magioladitis (talk) 01:20, 19 November 2014 (UTC)
 * Magioladitis, Here are the [//en.wikipedia.org/w/index.php?title=Special:Contributions&dir=prev&offset=20141122230319&limit=100&tagfilter=&contribs=user&target=SporkBot&namespace= 100 edits]. Thanks! Plastikspork ―Œ (talk)  00:10, 23 November 2014 (UTC)


 * I examined all 100 edits and found no problems. The bot removed the first parameter every time, as intended. It removed empty parameters where an empty or filled-in parameter existed later in the template, and it removed populated parameters with values identical to values in a parameter with the same name later in the template. It even found instances where there were three of the same parameter and removed the first two empty parameters. Nice work. – Jonesey95 (talk) 01:00, 23 November 2014 (UTC)


 * Can the bot find identical parameters that are not immediately adjacent to one another? For example,  in 1990 Fort Lauderdale Strikers season. – Jonesey95 (talk) 01:03, 23 November 2014 (UTC)

Given no objections and apparently good trial. Cheers =) -- slakr \ talk / 03:04, 10 December 2014 (UTC)


 * 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.