RIS update from Sean (pushed to repo) (ignore some extra whitespace differences)

This commit is contained in:
Dan Stillman 2007-01-20 00:21:58 +00:00
parent 1112fcf1ff
commit 61dba96bf8

View File

@ -22,7 +22,7 @@
-- Set the following timestamp to the most recent scraper update date -- Set the following timestamp to the most recent scraper update date
REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-01-18 23:00:00')); REPLACE INTO version VALUES ('repository', STRFTIME('%s', '2007-01-20 00:20:00'));
REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b3.r1', '', '2006-12-15 03:40:00', 1, 100, 4, 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon', REPLACE INTO translators VALUES ('96b9f483-c44d-5784-cdad-ce21b984fe01', '1.0.0b3.r1', '', '2006-12-15 03:40:00', 1, 100, 4, 'Amazon.com', 'Sean Takats', '^https?://(?:www\.)?amazon',
'function detectWeb(doc, url) { 'function detectWeb(doc, url) {
@ -8153,7 +8153,7 @@ function doImport() {
} }
}'); }');
REPLACE INTO translators VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '1.0.0b3.r1', '', '2007-01-12 00:30:00', 1, 100, 3, 'RIS', 'Simon Kornblith', 'ris', REPLACE INTO translators VALUES ('32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7', '1.0.0b3.r1', '', '2007-01-20 00:20:00', '1', '100', '3', 'RIS', 'Simon Kornblith', 'ris',
'Zotero.configure("dataMode", "line"); 'Zotero.configure("dataMode", "line");
Zotero.addOption("exportNotes", true); Zotero.addOption("exportNotes", true);
@ -8189,7 +8189,6 @@ function detectImport() {
var inputFieldMap = { var inputFieldMap = {
TI:"title", TI:"title",
CT:"title", CT:"title",
JO:"publicationTitle",
CY:"place" CY:"place"
}; };
@ -8197,6 +8196,7 @@ var inputFieldMap = {
var typeMap = { var typeMap = {
book:"BOOK", book:"BOOK",
bookSection:"CHAP", bookSection:"CHAP",
conferencePaper:"CONF",
journalArticle:"JOUR", journalArticle:"JOUR",
magazineArticle:"MGZN", magazineArticle:"MGZN",
newspaperArticle:"NEWS", newspaperArticle:"NEWS",
@ -8210,7 +8210,7 @@ var typeMap = {
}; };
// supplements outputTypeMap for importing // supplements outputTypeMap for importing
// TODO: BILL, CASE, COMP, CONF, DATA, HEAR, MUSIC, PAT, SOUND, STAT // TODO: BILL, CASE, COMP, DATA, HEAR, MUSIC, PAT, SOUND, STAT
var inputTypeMap = { var inputTypeMap = {
ABST:"journalArticle", ABST:"journalArticle",
ADVS:"film", ADVS:"film",
@ -8250,6 +8250,12 @@ function processTag(item, tag, value) {
item.itemType = inputTypeMap["GEN"]; item.itemType = inputTypeMap["GEN"];
} }
} }
} else if(tag == "JO") {
if (item.itemType == "conferencePaper"){
item.conferenceName = value;
} else {
item.publicationTitle = value;
}
} else if(tag == "BT") { } else if(tag == "BT") {
// ignore, unless this is a book or unpublished work, as per spec // ignore, unless this is a book or unpublished work, as per spec
if(item.itemType == "book" || item.itemType == "manuscript") { if(item.itemType == "book" || item.itemType == "manuscript") {
@ -8286,9 +8292,9 @@ function processTag(item, tag, value) {
} }
item.date = Zotero.Utilities.formatDate({year:dateParts[0], item.date = Zotero.Utilities.formatDate({year:dateParts[0],
month:month, month:month,
day:dateParts[2], day:dateParts[2],
part:dateParts[3]}); part:dateParts[3]});
} }
} else if(tag == "Y2") { } else if(tag == "Y2") {
// the secondary date field can mean two things, a secondary date, or an // the secondary date field can mean two things, a secondary date, or an
@ -8304,7 +8310,7 @@ function processTag(item, tag, value) {
} }
} else if(tag == "N1" || tag == "AB") { } else if(tag == "N1" || tag == "AB") {
// notes // notes
if(value != item.title) { // why does EndNote do this!? if(value != item.title) { // why does EndNote do this!?
item.notes.push({note:value}); item.notes.push({note:value});
} }
} else if(tag == "N2") { } else if(tag == "N2") {
@ -8316,7 +8322,7 @@ function processTag(item, tag, value) {
// start page // start page
if(!item.pages) { if(!item.pages) {
item.pages = value; item.pages = value;
} else if(item.pages[0] == "-") { // already have ending page } else if(item.pages[0] == "-") { // already have ending page
item.pages = value + item.pages; item.pages = value + item.pages;
} else { // multiple ranges? hey, it''s a possibility } else { // multiple ranges? hey, it''s a possibility
item.pages += ", "+value; item.pages += ", "+value;
@ -8368,7 +8374,6 @@ function completeItem(item) {
} }
item.backupPublicationTitle = undefined; item.backupPublicationTitle = undefined;
} }
item.complete(); item.complete();
} }
@ -8379,7 +8384,7 @@ function doImport(attachments) {
var line = true; var line = true;
var tag = data = false; var tag = data = false;
do { // first valid line is type do { // first valid line is type
Zotero.debug("ignoring "+line); Zotero.debug("ignoring "+line);
line = Zotero.read(); line = Zotero.read();
line = line.replace(/^\s+/, ""); line = line.replace(/^\s+/, "");
@ -8394,7 +8399,7 @@ function doImport(attachments) {
var tag = "TY"; var tag = "TY";
var data = line.substr(6); var data = line.substr(6);
var rawLine; var rawLine;
while((rawLine = Zotero.read()) !== false) { // until EOF while((rawLine = Zotero.read()) !== false) { // until EOF
// trim leading space if this line is not part of a note // trim leading space if this line is not part of a note
line = rawLine.replace(/^\s+/, ""); line = rawLine.replace(/^\s+/, "");
Zotero.debug("line is "+rawLine); Zotero.debug("line is "+rawLine);
@ -8411,7 +8416,7 @@ function doImport(attachments) {
Zotero.debug("tag: ''"+tag+"''; data: ''"+data+"''"); Zotero.debug("tag: ''"+tag+"''; data: ''"+data+"''");
if(tag == "ER") { // ER signals end of reference if(tag == "ER") { // ER signals end of reference
// unset info // unset info
tag = data = false; tag = data = false;
// new item // new item