diff --git a/scrapers.sql b/scrapers.sql index 9de38e70e..a14bb331a 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-14 16:30:00')); +REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2008-04-14 18:15: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) { @@ -9479,7 +9479,7 @@ REPLACE INTO translators VALUES ('5e3e6245-83da-4f55-a39b-b712df54a935', '1.0.0b Zotero.wait(); }'); -REPLACE INTO translators VALUES ('cf87eca8-041d-b954-795a-2d86348999d5', '1.0.0b3.r1', '', '2008-04-11 08:30:00', '1', '100', '4', 'Library Catalog (Aleph)', 'Simon Kornblith and Michael Berkowitz', 'https?://[^/]+/F(?:/[A-Z0-9\-]+(?:\?.*)?$|\?func=find|\?func=scan)', +REPLACE INTO translators VALUES ('cf87eca8-041d-b954-795a-2d86348999d5', '1.0.0b3.r1', '', '2008-04-14 18:15:00', '1', '100', '4', 'Library Catalog (Aleph)', 'Simon Kornblith and Michael Berkowitz', 'https?://[^/]+/F(?:/[A-Z0-9\-]+(?:\?.*)?$|\?func=find|\?func=scan)', 'function detectWeb(doc, url) { var singleRe = new RegExp("^https?://[^/]+/F/[A-Z0-9\-]+\?.*(?:func=full-set-set.*\&format=[0-9]{3}|func=direct)"); @@ -9556,7 +9556,6 @@ REPLACE INTO translators VALUES ('cf87eca8-041d-b954-795a-2d86348999d5', '1.0.0b xpath = ''//tr/td[2]/table/tbody[tr/td[contains(text(), "LDR")]]/tr''; nonstandard = true; } - Zotero.debug(xpath); var elmts = newDoc.evaluate(xpath, newDoc, nsResolver, XPathResult.ANY_TYPE, null); var elmt; var record = new marc.record(); @@ -9612,11 +9611,11 @@ REPLACE INTO translators VALUES ('cf87eca8-041d-b954-795a-2d86348999d5', '1.0.0b } for each (var a in transient) { if (a.firstName) { - if (a.firstName.match(/|/)) a.firstName = a.firstName.match(/([^|]+)\s+|/)[1]; + if (a.firstName.match(/\|/)) a.firstName = a.firstName.match(/([^|]+)\s+|/)[1]; } } newItem.creators = transient; - + newItem.title = newItem.title.replace(/(<<|>>)/g, ''''); newItem.complete(); }, function() {Zotero.done;}); Zotero.wait(); @@ -20466,7 +20465,7 @@ function doExport() { }'); -REPLACE INTO translators VALUES ('a6ee60df-1ddc-4aae-bb25-45e0537be973', '1.0.0b3.r1', '', '2008-04-14 16:30:00', '1', '100', '1', 'MARC', 'Simon Kornblith', 'marc', +REPLACE INTO translators VALUES ('a6ee60df-1ddc-4aae-bb25-45e0537be973', '1.0.0b3.r1', '', '2008-04-14 18:15:00', '1', '100', '1', 'MARC', 'Simon Kornblith', 'marc', 'function detectImport() { var marcRecordRegexp = /^[0-9]{5}[a-z ]{3}$/ var read = Zotero.read(8); @@ -20814,23 +20813,23 @@ record.prototype.translate = function(item) { if (!item.place) this._associateDBField(item, "210", "a", "place"); if (!item.publisher) this._associateDBField(item, "210", "c", "publisher"); if (!item.date) this._associateDBField(item, "210", "d", "date"); - if (!item.creators) { - this._associateDBField(item, "700", "ab", "creator", author, "author", true); - this._associateDBField(item, "701", "ab", "creator", author, "author", true); - this._associateDBField(item, "702", "ab", "creator", author, "author", true); + for (var i = 700; i < 703; i++) { + if (this.getFieldSubfields(i)[0]) { + Zotero.debug(i + " is AOK"); + Zotero.debug(this.getFieldSubfields(i.toString())); + var aut = this.getFieldSubfields(i)[0]; + aut = aut[''b''].replace(/,\W+/g, "") + " " + aut[''a''].replace(/,\s/g, ""); + Zotero.debug(aut); + item.creators.push(Zotero.Utilities.cleanAuthor(aut, "author")); + } } + if(item.title) { item.title = Zotero.Utilities.capitalizeTitle(item.title); } if (this.getFieldSubfields("335")[0]) { item.title = item.title + ": " + this.getFieldSubfields("335")[0][''a'']; - } - - if (!item.creators[0][''firstName'']) { - item.creators = new Array(); - this._associateDBField(item, "700", "ah", "creator", author, "author", true); - } - + } } function doImport() {