Wikipedia:Bots/Requests for approval/Mr.Z-bot 5


 * The following discussion is an archived debate. Please do not modify it. Subsequent comments should be made in a new section. The result of the discussion was Symbol keep vote.svg Approved.  MBisanz  talk 01:14, 6 April 2009 (UTC)

Mr.Z-bot 5
Operator: Mr.Z-man

Automatic or Manually Assisted: Automatic

Programming Language(s): Python

Function Overview: replace unreferenced on BLPs with BLP unsourced

Edit period(s): 1 large run initially, then probably weekly after that

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

Function Details: Finds the intersection of Category:Living people and Category:All articles lacking sources and replaces unreferenced on the pages with BLP unsourced (or removes unreferenced if it has both) for proper categorization. I think there's about 19,000 pages that would be updated on the first, main run, and based on a query of recentchanges, about 40 per week after that. Mr.Z-man 01:15, 2 April 2009 (UTC)

Discussion
19,000 pages? Good Christ. More technically, I assume you've sampled the pages to ensure that all (or nearly all) will be appropriately modified if you change the template. Corner cases may need consideration here, too. Like pages that use the template multiple times (sometimes people put one in each unreferenced section) or pages that already have BLP_unreferenced on them in addition to Unreferenced. (This of course assumes you didn't exclude all of those already.) Other than that, the request looks good. --MZMcBride (talk) 01:46, 2 April 2009 (UTC)
 * If it has both templates, unreferenced would just be removed. If it uses unreferenced more than once, it'll log it somewhere for further review, as this would probably need to be replaced with a different template for sections. Mr.Z-man 02:19, 2 April 2009 (UTC)

This is fairly straightforward. BJ Talk 01:50, 2 April 2009 (UTC)
 * Per Marybelle, just making sure this is the replacement logic:

re.sub("unreferenced", "", page_text) if not re.search("BLP_unreferenced", page_text) page_text.insert(0, BLP_unreferenced) BJ Talk 02:13, 2 April 2009 (UTC)
 * I haven't actually written it yet, will probably do so tomorrow or this weekend. It will be slightly more complex than that, to account for the month/year parameter in the templates, redirects, and article issues (which I need to make sure supports the BLP one). Mr.Z-man 02:19, 2 April 2009 (UTC)

- edits. Mr.Z-man 04:26, 5 April 2009 (UTC)

Checked nearly all 100 diffs. All looked good to me. Minor quibble: can you sort the list alphabetically before running the bot on it? Especially for long runs, this helps give an idea of how much longer the bot has to go. (And I assume you dealt with all the possible corner cases in a nice manner, like inline uses of the template and use in combination with Article issues?) --MZMcBride (talk) 04:37, 5 April 2009 (UTC)
 * I changed the query to order by page title, so it should be basically in alphabetical order now. The source is at . If the "section" parameter is used on unreferenced or article issues, or it contains more than one use of either template, it'll skip the article. Mr.Z-man 04:52, 5 April 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.