diff --git a/chrome/chromeFiles/content/scholar/xpcom/translate.js b/chrome/chromeFiles/content/scholar/xpcom/translate.js index 8c5c70cea..fa7666c31 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/translate.js +++ b/chrome/chromeFiles/content/scholar/xpcom/translate.js @@ -827,6 +827,17 @@ Scholar.Translate.prototype._enableAsynchronous = function() { * called as selectItems() in translator code */ Scholar.Translate.prototype._selectItems = function(options) { + // hack to see if there are options + var haveOptions = false; + for(var i in options) { + haveOptions = true; + break; + } + + if(!haveOptions) { + throw "translator called select items with no items"; + } + if(this._handlers.select) { return this._runHandler("select", options); } else { // no handler defined; assume they want all of them diff --git a/scrapers.sql b/scrapers.sql index 0512d709e..c058cba1b 100644 --- a/scrapers.sql +++ b/scrapers.sql @@ -1,4 +1,4 @@ --- 72 +-- 73 -- Set the following timestamp to the most recent scraper update date REPLACE INTO "version" VALUES ('repository', STRFTIME('%s', '2006-08-31 22:44:00')); @@ -116,7 +116,7 @@ function doWeb(doc, url) { } var searchresults = Scholar.Utilities.gatherElementsOnXPath(doc, doc, xpath, nsResolver); - var items = Scholar.Utilities.getItemArray(doc, searchresults, ''^http://www\.amazon\.com/(gp/product/|exec/obidos/tg/detail/)'', ''^(Buy new|Hardcover|Paperback|Digital)$''); + var items = Scholar.Utilities.getItemArray(doc, searchresults, ''^http://www\.amazon\.com/(gp/product/|exec/obidos/tg/detail/|[^/]+/dp/)'', ''^(Buy new|Hardcover|Paperback|Digital)$''); items = Scholar.selectItems(items); if(!items) {