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

Operator: Cybercobra

Automatic or Manually assisted: Automatic Manual (at least for now; may file another BRfA for Automatic if this goes off without any hitches)

Programming language(s): Python (pywikipedia)

Source code available: User:CobraBot/Code (Will post shortly)

Function overview: Add OCLC# parameter to pages that use Template:Infobox Book based on ISBN in the infobox, if it is given.

Edit period(s): Several runs as my time permits until either task complete; periodic re-reruns (e.g. quarterly) as new pages & |isbn=-es added or BRfA for automatic running filed

Estimated number of pages affected: However many pages transclude Template:Infobox Book, and specify an ISBN (55% maybe?) (see [1]); Several thousand over the first week

Exclusion compliant (Y/N): Y (via pywikipedia defaults) N (Don't know how to easily implement it)

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

Function details:

  1. Bot chooses an article that transcludes Template:Infobox Book
  2. Bot locates the template in the article
  3. Bot checks if |oclc= parameter is present
    1. If yes, and value is non-whitespace, page is skipped (OCLC# already present). GOTO step 1.
    2. If yes, and value is whitespace, parameter is removed.
    3. If no, continue.
  4. Bot grabs |isbn= parameter
    1. If parameter not present, page is skipped (No ISBN to use for OCLC# lookup). GOTO step 1.
    2. The value of the parameter is obtained, extra preceding "ISBN" text or dashes are stripped from the obtained value
    3. If the value is "N/A" or similar, page is skipped (No useful ISBN to use for OCLC# lookup). GOTO step 1.
  5. Using a proprietary process, the corresponding OCLC# is found for the given ISBN. The title of the work corresponding to the OCLC# is also obtained.
  6. The OCLC# is added to the infobox body using the |oclc= parameter
  7. (In assisted editing mode only) The bot operator is presented with the title of the WP page, ISBN, OCLC#, and OCLC title and asked to confirm the change.
  8. Page changes are saved.
  9. GOTO 1 until all pages either processed or skipped.

Discussion[edit]

 Approved. After some further review of the trial edits, this bot seems to be doing just fine. No concerns, and good bot task - Kingpin13 (talk) 10:09, 25 September 2009 (UTC)[reply]

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.