Wikipedia:Bots/Requests for approval/Sambot 4


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

Sambot 4
Operator: [[Sam Korn ]] (smoddy)

Automatic or Manually Assisted: Automatic

Programming Language(s): PHP

Function Overview: Per request, to pages in specified subcategories of.

Edit period(s): Monthly

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

Function Details:

Load list of pages here. For every page in each category:

If the page is a category, move on.

Otherwise, load a list of templates on the page and a full listing of the corresponding talk page.

For each page, check for merge and disambiguation templates, and note them if found.

On the talk page...

If is present, move on.

Otherwise, check for the presence of or one of its redirects.

If the template is present, check the parameters class= and merge= are present if necessary, adding them if not. (If class= is not present and the page is not a disambiguation page or a template, look elsewhere in the page and copy from there.)

If the template is not present, construct it using class= and merge= as above. If or suchlike is present, add it to that. Otherwise, work from the top of the page and place it after all other talk page headers.

Save talk page.

Source code available here.

[[Sam Korn ]] (smoddy) 17:39, 23 March 2009 (UTC)

Discussion
Code edited. New features include halving the number of API requests (using the toolserver databases instead) and, particularly excitingly, actually working. [[Sam Korn ]] (smoddy) 21:20, 23 March 2009 (UTC)
 * Seems like the bread and butter of the bot world. No problems forseeable, so... - Jarry1250 (t, c) 18:53, 25 March 2009 (UTC)
 * Just the one problem with this edit. The problem is now fixed.   [[Sam Korn ]] (smoddy) 19:21, 25 March 2009 (UTC)
 * All looks fine/uncontroversial/simple etc to me. - Jarry1250 (t, c) 17:33, 27 March 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.