From 431bb6f33f6955ab704f734f4ca65a9fa1b1c7ee Mon Sep 17 00:00:00 2001 From: Michael Berkowitz Date: Wed, 14 May 2008 18:52:17 +0000 Subject: [PATCH] -Adds FreeDictionary.com translator. --- scrapers.sql | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/scrapers.sql b/scrapers.sql index 64e5ff9bb..71e7feb57 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-05-14 16:30:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-05-14 20:00: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) { @@ -1149,6 +1149,23 @@ REPLACE INTO translators VALUES ('83538f48-906f-40ef-bdb3-e94f63676307', '1.0.0b }, function() {Zotero.done;}); }'); +REPLACE INTO translators VALUES ('0c661209-5ec8-402b-8f18-7dec6ae37d95', '1.0.0b4.r5', '', '2008-05-14 20:00:00', '0', '100', '4', 'The Free Dictionary', 'Michael Berkowitz', 'http://(.*\.)?thefreedictionary.com/(\w+)', +'function detectWeb(doc, url) { + return "dictionaryEntry"; +}', +'function doWeb(doc, url) { + var item = new Zotero.Item(''dictionaryEntry''); + item.title = Zotero.Utilities.capitalizeTitle(url.replace("+", " ").match(/[^/]+$/)[0]); + item.dictionaryTitle = "The Free Dictionary"; + var defs = doc.evaluate(''//div[@class="pseg"]'', doc, null, XPathResult.ANY_TYPE, null); + var def; + while (def = defs.iterateNext()) { + item.notes.push({note:Zotero.Utilities.trimInternal(def.textContent)}); + } + item.url = + item.complete(); +}'); + REPLACE INTO translators VALUES ('46291dc3-5cbd-47b7-8af4-d009078186f6', '1.0.0b4.r5', '', '2008-05-13 20:00:00', '0', '100', '4', 'CiNii', 'Michael Berkowitz', 'http://ci.nii.ac.jp/naid/', 'function detectWeb(doc, url) { if (url.match(/(naid|QuotDisp)/)) {