{
"translatorID": "88e11bcb-464d-4b6d-a446-8994e3b865c9",
"label": "Web of Science",
"creator": "Philipp Zumstein",
"target": "^https?://([^/]+\\.)?webofknowledge\\.com/",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsib",
"lastUpdated": "2015-06-04 04:20:22"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2015 Philipp Zumstein
This file is part of Zotero.
Zotero is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Zotero is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with Zotero. If not, see .
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, url) {
if ( (url.includes("full_record.do")
|| url.includes("CitedFullRecord.do")
|| url.includes("InboundService.do") )
&& getSingleItemId(doc)
) {
return "journalArticle";
} else if (((doc.title.includes(" Results"))
|| url.includes("search_mode="))
&& getRecords(doc).length) {
return "multiple";
}
}
function getRecords(doc) {
return ZU.xpath(doc, '//span[@id="records_chunks"]//div[starts-with(@id,"RECORD_")]');
}
function getSingleItemId(doc) {
var form = doc.forms['records_form'];
if (form) return (form.elements.namedItem('marked_list_candidates') || {}).value;
return false;
}
function doWeb(doc, url) {
var ids = new Array();
if (detectWeb(doc, url) == "multiple") {
var items = new Object;
var records = getRecords(doc);
var recordID, title;
for (var i=0, n=records.length; i]+name=(['"]?)qid\1[\s\/][^>]*/);
if (qid) qid = qid[0].match(/value=['"]?(\d+)/);
if (qid) {
qid = qid[1];
} else {
qid = postData['qid']*1+1; //this can be wrong if pages are refreshed
Z.debug("Could not find qid on page. Using 1 + previous qid: " + qid);
text = text.replace(/\s*[\r\n]\s*/g, '\n'); //trim out the extra newlines
var forms = text.match(/