commit Avram's update PubMed translator
This commit is contained in:
parent
f5630a38cf
commit
0f83076252
1 changed files with 7 additions and 4 deletions
|
@ -2,13 +2,13 @@
|
||||||
"translatorID":"fcf41bed-0cbc-3704-85c7-8062a0068a7a",
|
"translatorID":"fcf41bed-0cbc-3704-85c7-8062a0068a7a",
|
||||||
"translatorType":12,
|
"translatorType":12,
|
||||||
"label":"NCBI PubMed",
|
"label":"NCBI PubMed",
|
||||||
"creator":"Simon Kornblith, Michael Berkowitz and Rintze Zelle",
|
"creator":"Simon Kornblith, Michael Berkowitz, Avram Lyon, and Rintze Zelle",
|
||||||
"target":"http://[^/]*(www|preview)\\.ncbi\\.nlm\\.nih\\.gov[^/]*/(pubmed|sites/entrez|entrez/query\\.fcgi\\?.*db=PubMed)",
|
"target":"http://[^/]*(www|preview)\\.ncbi\\.nlm\\.nih\\.gov[^/]*/(pubmed|sites/pubmed|sites/entrez|entrez/query\\.fcgi\\?.*db=PubMed)",
|
||||||
"minVersion":"1.0.0b3.r1",
|
"minVersion":"1.0.0b3.r1",
|
||||||
"maxVersion":"",
|
"maxVersion":"",
|
||||||
"priority":100,
|
"priority":100,
|
||||||
"inRepository":true,
|
"inRepository":true,
|
||||||
"lastUpdated":"2010-04-12 16:40:00"
|
"lastUpdated":"2010-06-04 16:40:00"
|
||||||
}
|
}
|
||||||
|
|
||||||
function detectWeb(doc, url) {
|
function detectWeb(doc, url) {
|
||||||
|
@ -20,6 +20,7 @@ function detectWeb(doc, url) {
|
||||||
var items = doc.evaluate('//input[@name="EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_ResultsController.ResultCount"]', doc,
|
var items = doc.evaluate('//input[@name="EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_ResultsController.ResultCount"]', doc,
|
||||||
nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
|
nsResolver, XPathResult.ANY_TYPE, null).iterateNext();
|
||||||
if (items) {
|
if (items) {
|
||||||
|
Zotero.debug("Have ResultCount " + items.value);
|
||||||
if (items.value > 1) {
|
if (items.value > 1) {
|
||||||
return "multiple";
|
return "multiple";
|
||||||
} else if (items.value == 1) {
|
} else if (items.value == 1) {
|
||||||
|
@ -173,7 +174,7 @@ function doWeb(doc, url) {
|
||||||
if (prefix == 'x') return namespace; else return null;
|
if (prefix == 'x') return namespace; else return null;
|
||||||
} : null;
|
} : null;
|
||||||
var ids = new Array();
|
var ids = new Array();
|
||||||
var uids = doc.evaluate('//input[@type="checkbox" or @name="uid"]', doc, //edited for new PubMed
|
var uids = doc.evaluate('//input[@name="EntrezSystem2.PEntrez.Pubmed.Pubmed_ResultsPanel.Pubmed_RVDocSum.uid"]', doc, //edited for new PubMed
|
||||||
nsResolver, XPathResult.ANY_TYPE, null);
|
nsResolver, XPathResult.ANY_TYPE, null);
|
||||||
var uid = uids.iterateNext();
|
var uid = uids.iterateNext();
|
||||||
if(uid) {
|
if(uid) {
|
||||||
|
@ -225,6 +226,7 @@ function doWeb(doc, url) {
|
||||||
}
|
}
|
||||||
if (uid) {
|
if (uid) {
|
||||||
ids.push(uid.textContent.match(/\d+/)[0]);
|
ids.push(uid.textContent.match(/\d+/)[0]);
|
||||||
|
Zotero.debug("Found PMID: " + ids[ids.length - 1]);
|
||||||
lookupPMIDs(ids, doc);
|
lookupPMIDs(ids, doc);
|
||||||
} else {
|
} else {
|
||||||
var uids= doc.evaluate('//meta[@name="ncbi_uidlist"]', doc,
|
var uids= doc.evaluate('//meta[@name="ncbi_uidlist"]', doc,
|
||||||
|
@ -232,6 +234,7 @@ function doWeb(doc, url) {
|
||||||
var uid = uids.iterateNext()["content"].split(' ');
|
var uid = uids.iterateNext()["content"].split(' ');
|
||||||
if (uid) {
|
if (uid) {
|
||||||
ids.push(uid);
|
ids.push(uid);
|
||||||
|
Zotero.debug("Found PMID: " + ids[ids.length - 1]);
|
||||||
lookupPMIDs(ids, doc);
|
lookupPMIDs(ids, doc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue