Grabbing OCLC numbers

Is there a way to grab OCLC numbers of books when getting them from Worldcat using the Chrome Connector (or another one, I can switch browsers)? I’d like them to go into a field within Zotero’s entries somehow; for example if Worldcat permalinks (which end in OCLC numbers) were captured in the URL field of the items, this would be ideal.

I’m a professor who has been given a large number of books for our library by a generous donor. A research assistant is going through the boxes and putting the citations into Zotero. For books with ISBNs, she is doing this by putting the ISBN into WorldCat and grabbing the information through the Chrome Connector. However in order to enter the books into their system with more ease the library will need the OCLC number of each item, especially because most of the more important books do not have ISBNs. At the moment my RA is doing this by copy-pasting each OCLC number from Worldcat, but this gets a bit tedious and I’d like to know whether there’s a more automatic way to do it.
  • It would be easy enough to do by custom modifying the translator.
    You could do something like add
    if (url) item.url = url;
    as line 80 of the translator
    https://github.com/zotero/translators/blob/master/Open WorldCat.js#L80

    Just open the file "Open WorldCat.js", which you'll find in the translator folder in Zotero's data directory:
    http://www.zotero.org/support/zotero_data
    in a text editor (notepad, TextEdit) and paste the line above into line 80.

    You could even do something fancier like

    if (url && url.match(/oclc\/(\d+)/)){
    item.extra = url.match(/oclc\/(\d+)/)[1]
    }


    Which will put the OCLC number into the extra field (insert at about the same location

    These translator changes will be overwritten when the translator is update, but that shouldn't happen all that often.
  • This is fantastic, adamsmith, exactly what I've been looking for! Thanks also for the suggestion regarding the regex code to extract the OCLC number; I haven't used it yet but I've saved it in case I need it. Many, many thanks.
  • Two years later, this seems to have broken. Is there a new line number or new code to make it work once more?
Sign In or Register to comment.