{ "translatorID": "838d8849-4ffb-9f44-3d0d-aa8a0a079afe", "label": "OCLC WorldCat FirstSearch", "creator": "Simon Kornblith", "target": "https?://[^/]*firstsearch\\.oclc\\.org[^/]*/WebZ/", "minVersion": "1.0.0b3.r1", "maxVersion": "", "priority": 100, "inRepository": true, "translatorType": 4, "browserSupport": "g", "lastUpdated": "2013-02-25 18:54:22" } function detectWeb(doc, url) { var detailRe = /FirstSearch: [\w ]+ Detailed Record/; var searchRe = /FirstSearch: [\w ]+ List of Records/; if(detailRe.test(doc.title)) { return "book"; } else if(searchRe.test(doc.title)) { return "multiple"; } } function processURLs(urls, url) { if(!urls.length) { // last url Zotero.done(); return; } var newUrl = urls.shift(); //if non-roman characters are shown, shift the charset to utf-8, //else move it to iso8859 so that accented roman letters work if (url.match(/dfltcharset\=UTF\-8/)) var charset="utf-8"; else var charset="iso-8859-1" Zotero.Utilities.HTTP.doPost(newUrl, 'exportselect=record&exporttype=wc-endnote', function(text) { Z.debug(text) var lineRegexp = new RegExp(); lineRegexp.compile("^([\\w() ]+): *(.*)$"); var newItem = new Zotero.Item("book"); var notes = ""; var lines = text.split('\n'); for(var i=0;i