commit 78951c34ed8169d70f8fc841a3010ce19f6309d1
parent 83781293dac221593b12df423e7adf7c6d089d9e
Author: Matt Burton <mcburton@gmail.com>
Date: Fri, 2 Oct 2009 03:23:54 +0000
Fixing broken regex in PubMed Central
Diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/translators/PubMed Central.js b/translators/PubMed Central.js
@@ -8,7 +8,7 @@
"maxVersion":"",
"priority":100,
"inRepository":true,
- "lastUpdated":"2009-09-03 17:00:00"
+ "lastUpdated":"2009-10-01 23:22:00"
}
function detectWeb(doc, url) {
@@ -44,6 +44,7 @@ function doWeb(doc, url) {
next_link = links.iterateNext();
}
items = Zotero.selectItems(items);
+ if(!items) return true;
for (var i in items) {
URIs.push(i);
}
@@ -74,7 +75,11 @@ function doWeb(doc, url) {
}
newItem.url = tags["fulltext_html_url"];
if (!newItem.url) newItem.url = tags["abstract_html_url"];
- newItem.extra = "PMCID:" + text.match(/PMCID: <\/span>(\d+)/)[1];
+ try {
+ newItem.extra = "PMCID: " + text.match(/PMCID: <\/span>(PMC\d+)/)[1];
+ } catch(e){
+
+ }
newItem.journalAbbreviation = text.match(/span class=\"citation-abbreviation\">([^<]+)</)[1];
newItem.pages = text.match(/span class=\"citation-flpages\">([^<]+)</)[1].replace(/[\.:\s]/g, "");