{ "translatorID":"a77690cf-c5d1-8fc4-110f-d1fc765dcf88", "translatorType":4, "label":"ProQuest", "creator":"Simon Kornblith", "target":"^https?://[^/]+/pqdweb\\?((?:.*\\&)?did=.*&Fmt=[0-9]|(?:.*\\&)Fmt=[0-9].*&did=|(?:.*\\&)searchInterface=|(?:.*\\&)TS=[0-9])", "minVersion":"1.0.0b3.r1", "maxVersion":"", "priority":100, "inRepository":true, "lastUpdated":"2008-05-15 18:30:00" } function detectWeb(doc, url) { var namespace = doc.documentElement.namespaceURI; var nsResolver = namespace ? function(prefix) { if (prefix == 'x') return namespace; else return null; } : null; if(doc.evaluate('//img[substring(@src, string-length(@src)-32) = "/images/common/logo_proquest.gif" or substring(@src, string-length(@src)-38) = "/images/common/logo_proquest_small.gif"]', doc, nsResolver, XPathResult.ANY_TYPE, null)) { var xpath = '//table[@id="tableIndexTerms"]/tbody/tr/td[@class="textSmall"]'; var data= doc.evaluate(xpath, doc, nsResolver, XPathResult.ANY_TYPE, null); var aitem; var source; while(aitem = data.iterateNext()) { source=aitem.textContent; if(source=="Source type:") { source=data.iterateNext().textContent; Zotero.debug("Item Source Type: "+source); break; } } if(doc.title == "Results") { return "multiple"; } else if(doc.title == "Document View") { switch (source) { case 'Dissertation': return "thesis"; break; case 'Historical Newspaper': case 'Newspaper': return "newspaperArticle"; default: return "journalArticle"; break; } } } } //^https?://[^/]+/pqdweb\?((?:.*\&)?did=.*&Fmt=[0-9]|(?:.*\&)Fmt=[0-9].*&did=|(?:.*\&)searchInterface=) function parseRIS(uris) { Zotero.Utilities.HTTP.doGet(uris, function(text, xmlhttp, url){ // load translator for RIS if(url.match("exportFormat=1")=="exportFormat=1") { var translator = Zotero.loadTranslator("import"); translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7"); // Strip lines with just whitespace, which mess up RIS parsing text = text.replace(/^\s*$\n/gm, ''); translator.setString(text); //Set Handler fixes anomaly in Proquest RIS format. Properly formats author name as [last name], [first name] translator.setHandler("itemDone", function(obj, item) { var cre = new Array(); cre = item.creators; for each(var e in cre) { if(!e['firstName']) { //check if there is a first name, if not, take the first word in the last name var names = e['lastName'].split(" "); e['firstName']=names[0]; e['lastName']=""; for(var i = 1; i