Jump to content

Wikipedia:Bots/Requests for approval/Mobius Bot 3

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Mobius Clock (talk | contribs) at 09:07, 19 May 2010 (→‎Discussion: r). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Operator: Mobius Clock (talk · contribs)

Automatic or Manually assisted: Automatic

Programming language(s): Python

Source code available: After cleanup, this will be a link

Function overview: Fixing articles that have <ref> tags and/or template parameters which create references, but no <references/> or {{reflist}}, using this category.

Links to relevant discussions (where appropriate): Wikipedia:Bot_requests#Missing_reflist

Edit period(s): Periodically, category requires semi-constant clearing

Estimated number of pages affected: However many are in the category!

Exclusion compliant (Y/N): No, if necessary can be made so

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

Function details: Although SmackBot was approved to do this, it hasn't run this task in a while, and given that there has been a direct request for this kind of thing, I thought it can't hurt to have more than one bot available. Basically the bot will run through the 'pages with missing reflist' category, and add said reflist if: the page actually has references, excluding those in HTML comments, or the page contains a template with a parameter that automatically adds a reference, and there is no reflist or <references/> tag. One ref-generating parameter in the German location infobox (see BOTREQ) prompted this task, if any others exist, please let me know. The BOTREQ referred to running through the transclusions of the given template; I did a dry run and found that less than 5% of the pages needed to be fixed, and therefore I thought it more efficient to do the whole category, and cross the whole thing off the 'things what need fixing plz' list, at least temporarily.

Discussion

  • AWB is unable to add references to thousands of these cases because there is no visible ref tag. [1]. The reference comes from Infobox German location.
  • Where will Mobius Bot add the reflist tag? -- Magioladitis (talk) 21:51, 17 May 2010 (UTC)[reply]
    • The bot uses the standard pywikipedia methods to remove cats and interwikis, inserts the reflist, then 'floats' it above any other templates using a custom process, and finally sticks the cats and IWs back. In short, the reflist will end up before any templates, categories or IW links at the end of the article in question. Here's one of my userspace tests. - Mobius Clock 22:55, 17 May 2010 (UTC)[reply]

Approved for trial (30 edits). Please provide a link to the relevant contributions and/or diffs when the trial is complete. Lets see how this runs in the real world. Josh Parris 02:27, 18 May 2010 (UTC)[reply]

Trial complete. - Trial went without incident save for this slight bug, caused by the page having a template placed within the 'Further Reading' section or suchlike (i.e. in a bulleted/indented list). I've tweaked the regex to compensate, and ran a further test on a copy of an original page, which ran fine. - Mobius Clock 17:38, 18 May 2010 (UTC)[reply]
That's a high rate of occurrence of misplaced ==References==; would you be willing to detect that problem and record it on a list for humans to go and repair?
One edit reordered DEFAULTSORT away from the categories, that's probably undesirable - perhaps instead to put it at the end of the templates just before the categories. Josh Parris 07:07, 19 May 2010 (UTC)[reply]
When you say misplaced references, which ones are you referring to? If it's the ones I mentioned above (templates in lists), I did squash that bug. If you mean reordering DEFAULTSORT, I hadn't noticed that error; I've further modified the code, and now DEFAULTSORT will be left alone, and I've also tweaked things to avoid munging the order of page-footer items. I tried putting it after the templates, but that just looks wrong, I'd rather spend some time fixing any bugs and have the bot do a good job first time around rather than having to get humans to clean up after it. I have no problem with logging the bot's edits to a page on wiki, however, I just need to know which ones I should treat as 'suspect'. - Mobius Clock 09:07, 19 May 2010 (UTC)[reply]