www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 512ba9c30524dca5bdbb9f980f041e79b349fb11
parent 715584dca1417c6d7a95c69e46321b6fa2bef791
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 12 Apr 2010 19:26:51 +0000

Pushed PubMed


Diffstat:
Mtranslators/NCBI PubMed.js | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/translators/NCBI PubMed.js b/translators/NCBI PubMed.js @@ -8,7 +8,7 @@ "maxVersion":"", "priority":100, "inRepository":true, - "lastUpdated":"2010-04-08 13:10:00" + "lastUpdated":"2010-04-12 16:40:00" } function detectWeb(doc, url) { @@ -36,6 +36,7 @@ function detectWeb(doc, url) { return "journalArticle"; } } + function getPMID(co) { var coParts = co.split("&"); for each(part in coParts) { @@ -212,9 +213,16 @@ function doWeb(doc, url) { lookupPMIDs(ids, doc); } } else { + // Here, account for some articles and search results using spans for PMID var uids= doc.evaluate('//p[@class="pmid"]', doc, nsResolver, XPathResult.ANY_TYPE, null); var uid = uids.iterateNext(); + if (!uid) { + // Fall back on span + uids = doc.evaluate('//span[@class="pmid"]', doc, + nsResolver, XPathResult.ANY_TYPE, null); + uid = uids.iterateNext(); + } if (uid) { ids.push(uid.textContent.match(/\d+/)[0]); lookupPMIDs(ids, doc);