From 2e1fa819ab7945e174d8e6ad95400914cb44f1cf Mon Sep 17 00:00:00 2001 From: Sean Takats Date: Thu, 15 Feb 2007 22:42:36 +0000 Subject: [PATCH] Closes #516 for PubMed direct hits and refines Max Planck VL Library support --- scrapers.sql | 137 ++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/scrapers.sql b/scrapers.sql index 6586c0705..560aa7de6 100644 --- a/scrapers.sql +++ b/scrapers.sql @@ -1,4 +1,4 @@ --- 172 +-- 173 -- ***** BEGIN LICENSE BLOCK ***** -- @@ -22,7 +22,7 @@ -- Set the following timestamp to the most recent scraper update date -REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-02-07 02:10:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-02-15 22:50:00')); REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b3.r1', '', '2006-12-15 03:40:00', 1, 100, 4, 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', 'function detectWeb(doc, url) { @@ -2747,21 +2747,22 @@ REPLACE INTO translators VALUES ('c54d1932-73ce-dfd4-a943-109380e06574', '1.0.0b } }'); -REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2006-12-14 17:53:00', 1, 100, 12, 'NCBI PubMed', 'Simon Kornblith', '^http://www\.ncbi\.nlm\.nih\.gov/entrez/query\.fcgi\?.*db=PubMed', +REPLACE INTO translators VALUES ('fcf41bed-0cbc-3704-85c7-8062a0068a7a', '1.0.0b3.r1', '', '2007-02-15 22:50:00', '1', '100', '4', 'NCBI PubMed', 'Simon Kornblith', '^http://www\.ncbi\.nlm\.nih\.gov/entrez/query\.fcgi\?.*db=PubMed', '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.location.href.indexOf("list_uids=") >= 0) { + + var uids = doc.evaluate(''//input[@name="uid"]'', doc, + nsResolver, XPathResult.ANY_TYPE, null); + if(uids.iterateNext()) { + if (uids.iterateNext()){ + return "multiple"; + } return "journalArticle"; - } else if(doc.evaluate(''//div[@class="ResultSet"]/table/tbody'', doc, - nsResolver, XPathResult.ANY_TYPE, null).iterateNext()) { - return "multiple"; } } - function getPMID(co) { var coParts = co.split("&"); for each(part in coParts) { @@ -2781,34 +2782,35 @@ function detectSearch(item) { } } return false; -}', +} +', 'function lookupPMIDs(ids, doc) { Zotero.wait(); - + var newUri = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=PubMed&retmode=xml&rettype=citation&id="+ids.join(","); Zotero.Utilities.HTTP.doGet(newUri, function(text) { // Remove xml parse instruction and doctype text = text.replace(/]*>/, "").replace(/<\?xml[^>]*\?>/, ""); - + var xml = new XML(text); - + for(var i=0; i