Skip to content
Permalink
Browse files

Small fixes for Ozon, business Wekk, and Live Journal. Test updates f…

…or the rest.

Notes: Sorry for the diff-mess in the OZON translator, the indents in the original were completely off. NZZ: The authors have vanished from their article sites - nothing to do. Nature: The "ERROR NO ISSN!" comes straight from the metadata on the site - it's the same in all ISSN fields.
  • Loading branch information...
adam3smith committed Jun 30, 2012
1 parent 8ac8cc1 commit 095f225b75c1a42db7dcdeac43f0b2e104aa891e
Showing with 423 additions and 566 deletions.
  1. +31 −24 BusinessWeek.js
  2. +2 −2 Digital Humanities Quarterly.js
  3. +1 −45 Glenbow Library.js
  4. +1 −52 L'Annee Philologique.js
  5. +8 −6 Library Catalog (Mango).js
  6. +3 −3 LiveJournal.js
  7. +6 −19 NZZ.ch.js
  8. +6 −7 Nature Publishing Group.js
  9. +365 −408 OZON.ru.js
@@ -3,19 +3,19 @@
"label": "BusinessWeek",
"creator": "Michael Berkowitz",
"target": "^https?://(www\\.)?businessweek\\.com",
"minVersion": "1.0.0b4.r5",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsv",
"lastUpdated": "2012-01-30 22:52:13"
"lastUpdated": "2012-06-30 09:46:05"
}

function detectWeb(doc, url) {
if (doc.title == "BusinessWeek Search Results") {
if (doc.evaluate('//body[contains(@class, "searchResults")]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
return "multiple";
} else if (doc.evaluate('//meta[@name="headline"]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
} else if (doc.evaluate('//h1[@id="article_headline"]', doc, null, XPathResult.ANY_TYPE, null).iterateNext()) {
return "magazineArticle";
}
}
@@ -29,35 +29,41 @@ function doWeb(doc, url) {
while (result = results.iterateNext()) {
items[result.href] = Zotero.Utilities.trimInternal(result.textContent);
}
items = Zotero.selectItems(items);
for (var i in items) {
articles.push(i);
}
Zotero.selectItems(items, function (items) {
if (!items) {
return true;
}
for (var i in items) {
articles.push(i);
}
Zotero.Utilities.processDocuments(articles, scrape, function () {
Zotero.done();
});
});
} else {
articles = [url];
scrape(doc, url)
}
Zotero.debug(articles);
Zotero.Utilities.processDocuments(articles, function(newDoc) {
var metaTags = new Object();
var metas = newDoc.evaluate('//meta', newDoc, null, XPathResult.ANY_TYPE, null);
}

function scrape(doc, url){
var metaTags = new Object();
var metas = doc.evaluate('//meta', doc, null, XPathResult.ANY_TYPE, null);
var meta;
while (meta = metas.iterateNext()) {
metaTags[meta.name] = meta.content;
}
Zotero.debug(metaTags);
var item = new Zotero.Item("magazineArticle");
item.title = metaTags['headline'];
item.abstractNote = metaTags['abstract'];
item.title = ZU.xpathText(doc, '//h1[@id="article_headline"]');
item.abstractNote = metaTags['description'];
item.tags = metaTags['keywords'].split(/\s*,\s*/);
//some articles don't have author tags - prevent this from failing
if (metaTags['author']) item.creators.push(Zotero.Utilities.cleanAuthor(metaTags['author'], "author"));
item.publicationTitle = "BusinessWeek: " + metaTags['channel'];
item.url = newDoc.location.href;
item.date = metaTags['pub_date'].replace(/(\d{4})(\d{2})(\d{2})/, "$2/$3/$1");
item.url = url;
item.date = metaTags['pub_date'].replace(/(\d{4})(\d{2})(\d{2})/, "$2/$3/$1").replace(/T.+/, "");
item.complete();
}, function() {Zotero.done();});
Zotero.wait();
}/** BEGIN TEST CASES **/
}/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
@@ -75,7 +81,7 @@ var testCases = [
"notes": [],
"tags": [
"leadership",
"management",
"Management",
"bad bosses",
"leaders",
"Liz Ryan",
@@ -85,9 +91,10 @@ var testCases = [
"seeAlso": [],
"attachments": [],
"title": "Ten Things Only Bad Managers Say",
"publicationTitle": "BusinessWeek: Management",
"abstractNote": "We know the kinds of things good managers say: They say “Attaboy” or “Attagirl,” “Let me know if you run into any roadblocks, and I’ll try to get rid of them for you,” and “You’ve been killing yourself—why don’t you take off at noon on Friday?”",
"publicationTitle": "BusinessWeek: management",
"url": "http://www.businessweek.com/management/ten-things-only-bad-managers-say-09232011.html?campaign_id=rss_topStories",
"date": "09/23/2011",
"date": "2011-09-23",
"libraryCatalog": "BusinessWeek",
"accessDate": "CURRENT_TIMESTAMP"
}
@@ -99,4 +106,4 @@ var testCases = [
"items": "multiple"
}
]
/** END TEST CASES **/
/** END TEST CASES **/
@@ -86,7 +86,7 @@ var testCases = [
],
"url": "http://www.digitalhumanities.org/dhq/vol/5/2/000094/000094.html",
"title": "Network Narration in John Dos Passos’s U.S.A. Trilogy",
"date": "Spring 2011",
"date": "2011",
"volume": "5",
"issue": "2",
"libraryCatalog": "Digital Humanities Quarterly",
@@ -100,4 +100,4 @@ var testCases = [
"items": "multiple"
}
]
/** END TEST CASES **/
/** END TEST CASES **/
@@ -264,48 +264,4 @@ function doWeb(doc, url) {
Zotero.Utilities.processDocuments(uris, scrape, function() {Zotero.done();});
Zotero.wait();
}

/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "http://ww2.glenbow.org/search/libraryMainResults.aspx?AC=GET_RECORD&XC=/search/libraryMainResults.aspx&BU=&TN=GLENCAT&SN=AUTO24715&SE=1581&RN=8&MR=20&TR=0&TX=1000&ES=0&CS=0&XP=&RF=WebResults&EF=&DF=WebResultsDetails&RL=0&EL=0&DL=0&NP=255&ID=&MF=WPEngMsg.ini&MQ=&TI=0&DT=&ST=0&IR=56813&NR=0&NB=0&SV=0&BG=&FG=&QS=LibraryMainSearch&OEX=ISO-8859-1&OEH=ISO-8859-1",
"items": [
{
"itemType": "book",
"creators": [
{
"firstName": "Marlene A. D. Lynne Van",
"lastName": "Luven",
"creatorType": "author"
},
{
"firstName": "Priscilla L.",
"lastName": "Walton",
"creatorType": "author"
}
],
"notes": [],
"tags": [
"Popular culture - Canada",
"Canada - Social life and customs - 20th century"
],
"seeAlso": [],
"attachments": [],
"callNumber": "306.40971 P831",
"title": "Pop Can : popular culture in Canada / edited by Lynne Van Luven, Priscilla L. Walton",
"place": "Scarborough, Ont.",
"publisher": "Prentice Hall Allyn and Bacon Canada",
"date": "c1999.",
"pages": "xii, 237 p. ; 24 cm.",
"abstractNote": "Includes bibliographical references and index.",
"extra": "Accession number: [99092222]",
"url": "http://ww2.glenbow.org/search/libraryMainResults.aspx?AC=GET_RECORD&XC=/search/libraryMainResults.aspx&BU=&TN=GLENCAT&SN=AUTO24715&SE=1581&RN=8&MR=20&TR=0&TX=1000&ES=0&CS=0&XP=&RF=WebResults&EF=&DF=WebResultsDetails&RL=0&EL=0&DL=0&NP=255&ID=&MF=WPEngMsg.ini&MQ=&TI=0&DT=&ST=0&IR=56813&NR=0&NB=0&SV=0&BG=&FG=&QS=LibraryMainSearch&OEX=ISO-8859-1&OEH=ISO-8859-1",
"libraryCatalog": "Glenbow Library",
"accessDate": "CURRENT_TIMESTAMP",
"shortTitle": "Pop Can"
}
]
}
]
/** END TEST CASES **/
//Session time-out --> no tests
@@ -39,8 +39,6 @@
TODO: LAP provides book chapters as to separate RIS files - the chapter and the book
the former doesn't have the editors or the book title. Ideally we should merge those,
but that requires a rather elaborate hack, so it'll have to wait for another day
Test may fail - not sure if it's tied to a session
*/


@@ -115,53 +113,4 @@ function scrape(doc, url) {
translator.translate();
});
}
/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "http://www.annee-philologique.com/index.php?do=notice&num=5",
"items": [
{
"itemType": "book",
"creators": [
{
"lastName": "Diderot",
"creatorType": "author",
"firstName": " Denis"
},
{
"lastName": "Carpanetto",
"creatorType": "author",
"firstName": " Secondo"
},
{
"lastName": "Guerci",
"creatorType": "author",
"firstName": " Luciano"
},
{
"lastName": "Canfora",
"creatorType": "author",
"firstName": " Luciano"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [
{
"title": "L'Année Philologique Snapshot",
"mimeType": "text/html"
}
],
"itemID": "59-11596",
"title": "Saggio sui regni di Claudio e Nerone, e sui costumi e gli scritti di Seneca / trad. di Carpanetto Secondo& Guerci Luciano ;con una nota di Canfora Luciano",
"date": "1987",
"publisher": "Sellerio",
"place": "Palermo",
"libraryCatalog": "L'Année Philologique"
}
]
}
]
/** END TEST CASES **/
//no permalinks --> no test
@@ -8,8 +8,8 @@
"priority": 200,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsbv",
"lastUpdated": "2012-03-12 01:06:01"
"browserSupport": "gcsvb",
"lastUpdated": "2012-06-30 10:12:52"
}

/*
@@ -218,7 +218,9 @@ var testCases = [
"tags": [
"Psychological tests",
"Educational tests and measurements",
"Occupational aptitude tests"
"Occupational aptitude tests",
"Educational Measurement",
"Psychological Tests"
],
"seeAlso": [],
"attachments": [],
@@ -259,16 +261,16 @@ var testCases = [
"attachments": [],
"ISBN": "9780300169270",
"title": "Adam Smith: an enlightened life",
"place": "New Haven [Conn.] ; London",
"place": "New Haven, CT ; London",
"publisher": "Yale University Press",
"date": "2010",
"numPages": "345",
"callNumber": "HB103.S6 P45 2010",
"extra": "A Kirkcaldy upbringing -- Glasgow, Glasgow University and Francis Hutcheson's enlightenment -- Private study 1740-46 : Oxford and David Hume -- Edinburgh's early enlightenment -- Smith's Edinburgh lectures : a conjectural history -- Professor of moral philosophy at Glasgow, I. 1751-9 -- The 'Theory of moral sentiments' and the civilizing powers of commerce -- Professor of moral philosophy at Glasgow, 2. 1759-63 -- Smith and the Duke of Buccleuch in Europe 1764-6 -- London, Kirkcaldy and the making of the 'Wealth of nations' 1766-76 -- The 'Wealth of nations' and Smith's \"very violent attack ... upon the whole commercial system of Great Britain\" -- Hume's death -- Last years in Edinburgh 1778-90\nNicholas Phillipson's intellectual biography of Adam Smith shows that Smith saw himself as philosopher rather than an economist. Phillipson shows Smith's famous works were a part of a larger scheme to establish a \"Science of Man,\" which was to encompass law, history, and aesthetics as well as economics and ethics. Phillipson explains Adam Smith's part in the rapidly changing intellectual and commercial cultures of Glasgow and Edinburgh at the time of the Scottish Enlightenment. Above all Phillipson explains how far Smith's ideas developed in dialog with his closest friend David Hume. --Publisher's description",
"extra": "1. A Kirkcaldy upbringing -- 2. Glasgow, Glasgow University and Francis Hutcheson's enlightenment -- 3. Private study 1740-46: Oxford and David Hume -- 4. Edinburgh's early enlightenment -- 5. Smith's Edinburgh lectures: a conjectural history -- 6. Professor of moral philosophy at Glasgow, I. 1751-9 -- 7. The 'Theory of moral sentiments' and the civilizing powers of commerce -- 8. Professor of moral philosophy at Glasgow, 2. 1759-63 -- 9. Smith and the Duke of Buccleuch in Europe 1764-6 -- 10. London, Kirkcaldy and the making of the 'Wealth of nations' 1766-76 -- 11. The 'Wealth of nations' and Smith's \"very violent attack ... upon the whole commercial system of Great Britain\" -- 12. Hume's death -- 13. Last years in Edinburgh 1778-90 A Kirkcaldy upbringing -- Glasgow, Glasgow University and Francis Hutcheson's enlightenment -- Private study 1740-46 : Oxford and David Hume -- Edinburgh's early enlightenment -- Smith's Edinburgh lectures : a conjectural history -- Professor of moral philosophy at Glasgow, I. 1751-9 -- The 'Theory of moral sentiments' and the civilizing powers of commerce -- Professor of moral philosophy at Glasgow, 2. 1759-63 -- Smith and the Duke of Buccleuch in Europe 1764-6 -- London, Kirkcaldy and the making of the 'Wealth of nations' 1766-76 -- The 'Wealth of nations' and Smith's \"very violent attack ... upon the whole commercial system of Great Britain\" -- Hume's death -- Last years in Edinburgh 1778-90\nNicholas Phillipson's intellectual biography of Adam Smith shows that Smith saw himself as philosopher rather than an economist. Phillipson shows Smith's famous works were a part of a larger scheme to establish a \"Science of Man,\" which was to encompass law, history, and aesthetics as well as economics and ethics. Phillipson explains Adam Smith's part in the rapidly changing intellectual and commercial cultures of Glasgow and Edinburgh at the time of the Scottish Enlightenment. Above all Phillipson explains how far Smith's ideas developed in dialog with his closest friend David Hume. --Publisher's description",
"libraryCatalog": "Library Catalog (Mango)",
"shortTitle": "Adam Smith"
}
]
}
]
/** END TEST CASES **/
/** END TEST CASES **/

0 comments on commit 095f225

Please sign in to comment.
You can’t perform that action at this time.