diff --git a/scrapers.sql b/scrapers.sql index c7cf535de..feeda3e35 100644 --- a/scrapers.sql +++ b/scrapers.sql @@ -22,7 +22,7 @@ -- Set the following timestamp to the most recent scraper update date -REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-04-02 16:30:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-04-02 19:45:00')); REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2008-03-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats and Michael Berkowitz', '^https?://(?:www\.)?amazon', 'function detectWeb(doc, url) { @@ -1579,6 +1579,115 @@ function doWeb(doc, url) { } }'); +REPLACE INTO translators VALUES ('4c9dbe33-e64f-4536-a02f-f347fa1f187d', '1.0.0b4.r5', '', '2008-04-02 19:45:00', '0', '100', '4', 'BioInfoBank', 'Michael Berkowitz', 'http://lib.bioinfo.pl/', +'function detectWeb(doc, url) { + return "multiple"; +}', +'function doWeb(doc, url) { + var pmids = new Array(); + var items = new Object(); + var titles = doc.evaluate(''//div[@class="css_pmid"]/div[@class="css_pmid_title"]/a'', doc, null, XPathResult.ANY_TYPE, null); + var title; + while (title = titles.iterateNext()) { + items[title.href] = Zotero.Utilities.trimInternal(title.textContent); + } + items = Zotero.selectItems(items); + for (var i in items) { + pmids.push(i.match(/pmid:(\d+)/)[1]); + } + var newUri = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=PubMed&retmode=xml&rettype=citation&id="+pmids.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