{ "translatorID":"594ebe3c-90a0-4830-83bc-9502825a6810", "translatorType":4, "label":"ISI Web of Knowledge", "creator":"Michael Berkowitz", "target":"(WOS_GeneralSearch|product=WOS|product=CABI)", "minVersion":"2.0", "maxVersion":"", "priority":100, "inRepository":true, "lastUpdated":"2010-04-01 22:50:00" } function detectWeb(doc, url) { if ((doc.title.indexOf("Web of Science Results") != -1) | (doc.title.indexOf("CABI Results") != -1)) { return "multiple"; } else if (url.indexOf("full_record.do") != -1) { return "journalArticle"; } } function doWeb(doc, url) { var ids = new Array(); if (detectWeb(doc, url) == "multiple") { var items = new Object; var xpath = '//a[@class="smallV110"]'; var titles = doc.evaluate(xpath, doc, null, XPathResult.ANY_TYPE, null); var next_title; while (next_title = titles.iterateNext()) { items[next_title.href.match(/\?(.*)/)[1]] = next_title.textContent; } items = Zotero.selectItems(items); for (var i in items) { ids.push(i); } } else { ids.push(url.match(/\?(.*)/)[1]); } var hostRegexp = new RegExp("^(https?://[^/]+)/"); var m = hostRegexp.exec(url); var host = m[1]; for (var i in ids) { ids[i] = host+"/full_record.do?" + ids[i]; } var product = url.match("product=([^\&]+)\&")[1]; for (var i=0 ; i