From 6765e2cd03c7349c4de6476b2b36a0e0fed75cc8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 10 Jan 2008 09:34:03 +0000 Subject: [PATCH] Fix error on ACM --- scrapers.sql | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scrapers.sql b/scrapers.sql index 78bc4ccb4..37efe96e3 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-01-09 20:00:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-01-10 09:45:00')); REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b4.r1', '', '2007-06-21 20:00:00', '1', '100', '4', 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', 'function detectWeb(doc, url) { @@ -11783,7 +11783,7 @@ function doWeb(doc, url) { } }'); -REPLACE INTO translators VALUES ('e78d20f7-488-4023-831-dfe39679f3f', '1.0.0b3.r1', '', '2008-01-09 20:00:00', '1', '100', '4', 'ACM', 'Simon Kornblith', 'https?://[^/]*portal\.acm\.org[^/]*/(?:results\.cfm|citation\.cfm)', +REPLACE INTO translators VALUES ('e78d20f7-488-4023-831-dfe39679f3f', '1.0.0b3.r1', '', '2008-01-10 09:45:00', '1', '100', '4', 'ACM', 'Simon Kornblith', 'https?://[^/]*portal\.acm\.org[^/]*/(?:results\.cfm|citation\.cfm)', 'function detectWeb(doc, url) { if(url.indexOf("/results.cfm") != -1) { var items = Zotero.Utilities.getItemArray(doc, doc, ''^https?://[^/]+/citation.cfm\\?[^#]+$''); @@ -11851,9 +11851,12 @@ function scrape(doc) { } Zotero.Utilities.HTTP.doGet("http://portal.acm.org/"+m[1], function(text) { + // split() may no longer be necessary var m = text.split(/<\/?pre[^>]*>/ig); - var text = m[1]; - + if (m[1]) { + var text = m[1]; + } + // load Refer translator var translator = Zotero.loadTranslator("import"); translator.setTranslator("881f60f2-0802-411a-9228-ce5f47b64c7d");