Skip to content
Permalink
Browse files

Fixes and Updates - N (#1205)

* Update test, rename label in National Gallery of Art - USA.js
** Now, the label matches the file name, otherwise Scaffold will try to rename it every time.
* Update National Library of Australia (new catalog).js
* Update National Library of Norway.js
* Update Nature Publishing Group.js
** The one test with a Palgrave journal was deleted, because this journal moved to Springer Link.
** Is there still a journal published under the Palgrave website? Otherwise we may simplify the target regexp.

* Update test in NCBI Nucleotide.js
* Rewrite and rename NewsnetTamedia.js
* Update tests in NYTimes.com.js
* Update NZZ.ch.js
* Update newshub.co.nz.js
**Note: There are no tags anymore on that page.
  • Loading branch information...
zuphilip authored and adam3smith committed Jan 6, 2017
1 parent 3cdfb09 commit bd311c6725863233f24c8cfd00ae842aa2a38e74
@@ -191,13 +191,13 @@ var testCases = [
},
{
"type": "web",
"url": "http://www.ncbi.nlm.nih.gov/nuccore/NM_078524.4",
"url": "https://www.ncbi.nlm.nih.gov/nuccore/NM_078524.4",
"items": [
{
"itemType": "journalArticle",
"title": "Drosophila melanogaster smad on X (Smox), transcript variant A, mRNA",
"title": "Drosophila melanogaster smad on X, transcript variant A (Smox), mRNA",
"creators": [],
"date": "2014/08/05",
"date": "2016/12/13",
"archive": "NCBI Nucleotide Database",
"archiveLocation": "665390239",
"callNumber": "NM_078524.4",
@@ -214,7 +214,7 @@ var testCases = [
}
],
"tags": [
"Drosophila melanogaster",
"fruit fly",
"refseq",
"rna"
],
@@ -225,20 +225,24 @@ function doWeb(doc, url) {
var testCases = [
{
"type": "web",
"url": "http://query.nytimes.com/gst/abstract.html?res=F30D15FD3F5813738DDDAC0894DB405B828DF1D3",
"url": "http://query.nytimes.com/gst/abstract.html?res=9C07E4DC143CE633A25756C0A9659C946396D6CF&legacy=true",
"items": [
{
"itemType": "newspaperArticle",
"title": "TWO MONEY INQUIRIES.; Hearings of Trust Charges and Aldrich Plan at the Same Time.",
"creators": [
{
"firstName": "Special To The New York",
"lastName": "Times",
"creatorType": "author"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "1912-03-05",
"ISSN": "0362-4331",
"abstractNote": "WASHINGTON, March 4. -- The Money Trust inquiry and consideration of the proposed Aldrich monetary legislation will probably be handled side by side by the House Banking and Currency Committee. The present tentative plan is to divide the committee into two parts, one of which, acting as a sub-committee, will investigate as far as it can those allegations of the Henry Money Trust resolution which fall within the jurisdiction of the Banking and Currency Committee.",
"libraryCatalog": "NYTimes.com",
"publicationTitle": "The New York Times",
"url": "http://query.nytimes.com/gst/abstract.html?res=9C07E4DC143CE633A25756C0A9659C946396D6CF&legacy=true",
"attachments": [
{
"title": "New York Times Snapshot"
@@ -248,13 +252,9 @@ var testCases = [
"mimeType": "application/pdf"
}
],
"publicationTitle": "The New York Times",
"ISSN": "0362-4331",
"url": "http://query.nytimes.com/gst/abstract.html?res=9C07E4DC143CE633A25756C0A9659C946396D6CF",
"date": "1912-03-05",
"title": "TWO MONEY INQUIRIES.; Hearings of Trust Charges and Aldrich Plan at the Same Time.",
"abstractNote": "WASHINGTON, March 4. -- The Money Trust inquiry and consideration of the proposed Aldrich monetary legislation will probably be handled side by side by the House Banking and Currency Committee. The present tentative plan is to divide the committee into two parts, one of which, acting as a sub-committee, will investigate as far as it can those allegations of the Henry Money Trust resolution which fall within the jurisdiction of the Banking and Currency Committee.",
"libraryCatalog": "NYTimes.com"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
@@ -264,44 +264,41 @@ var testCases = [
"items": [
{
"itemType": "newspaperArticle",
"title": "Harvard Finds Marc Hauser Guilty of Scientific Misconduct",
"creators": [
{
"firstName": "Nicholas",
"lastName": "Wade",
"creatorType": "author"
}
],
"notes": [],
"tags": [
"Science and Technology",
"Research",
"Ethics",
"Hauser, Marc D",
"Harvard University"
],
"seeAlso": [],
"date": "2010-08-20",
"ISSN": "0362-4331",
"abstractNote": "The university has found Marc Hauser “solely responsible” for eight instances of scientific misconduct.",
"libraryCatalog": "NYTimes.com",
"publicationTitle": "The New York Times",
"url": "http://www.nytimes.com/2010/08/21/education/21harvard.html",
"attachments": [
{
"title": "New York Times Snapshot"
}
],
"publicationTitle": "The New York Times",
"ISSN": "0362-4331",
"url": "http://www.nytimes.com/2010/08/21/education/21harvard.html",
"date": "2010-08-20",
"title": "Harvard Finds Marc Hauser Guilty of Scientific Misconduct",
"abstractNote": "The university has found Marc Hauser “solely responsible” for eight instances of scientific misconduct.",
"section": "Education",
"accessionNumber": "1248068890906",
"libraryCatalog": "NYTimes.com",
"accessDate": "CURRENT_TIMESTAMP"
"tags": [
"Ethics",
"Harvard University",
"Hauser, Marc D",
"Research",
"Science and Technology"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"defer": true,
"url": "http://query.nytimes.com/search/sitesearch/#/marc+hauser",
"defer": true,
"items": "multiple"
},
{
@@ -310,32 +307,33 @@ var testCases = [
"items": [
{
"itemType": "blogPost",
"title": "Our Broken Social Contract",
"creators": [
{
"firstName": "Thomas B.",
"lastName": "Edsall",
"creatorType": "author"
}
],
"notes": [],
"date": "2013-06-19",
"abstractNote": "At their core, are America’s problems primarily economic or moral?",
"blogTitle": "The New York Times",
"url": "http://opinionator.blogs.nytimes.com/2013/06/19/our-broken-social-contract/",
"attachments": [
{
"title": "New York Times Snapshot"
}
],
"tags": [
"Economic Conditions and Trends",
"Income Inequality",
"Social Conditions and Trends",
"Thomas B. Edsall",
"United States",
"United States Economy"
],
"seeAlso": [],
"attachments": [
{
"title": "New York Times Snapshot"
}
],
"url": "http://opinionator.blogs.nytimes.com/2013/06/19/our-broken-social-contract/",
"abstractNote": "At their core, are America’s problems primarily economic or moral?",
"title": "Our Broken Social Contract",
"blogTitle": "The New York Times",
"date": "2013-06-19"
"notes": [],
"seeAlso": []
}
]
}
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-06-09 05:59:15"
"lastUpdated": "2016-12-28 20:01:06"
}

/*
@@ -88,8 +88,6 @@ function scrape(doc, url) {
translator.setDocument(doc);

translator.setHandler('itemDone', function (obj, item) {

item.date = ZU.xpathText(doc, '//article[contains(@class, "content")]//time/@datetime');

// Problem: also the place will be taken as part of the autor name
// e.g. <meta name="author" content="Matthias Müller, Peking">
@@ -125,6 +123,9 @@ function scrape(doc, url) {

translator.getTranslatorObject(function(trans) {
trans.itemType = "newspaperArticle";
trans.addCustomFields({
'date': 'date'
});
trans.doWeb(doc, url);
});
}
@@ -138,7 +139,7 @@ var testCases = [
"itemType": "newspaperArticle",
"title": "Deutliches Umsatzplus in den ersten neun Monaten: Kuoni profitiert von der GTA-Übernahme",
"creators": [],
"date": "2011-11-10T06:55:41+00:00",
"date": "2011-11-10 07:55:41",
"ISSN": "0376-6829",
"abstractNote": "Der Reisekonzern Kuoni hat in den ersten neun Monaten von der Übernahme des Reisekonzerns Gullivers Travel Associates (GTA) profitiert.",
"language": "de-CH",
@@ -172,7 +173,7 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2012-05-30T09:00:00+00:00, 2012-05-14T22:00:00+00:00",
"date": "2012-05-30 11:00:00",
"ISSN": "0376-6829",
"abstractNote": "Mit einem Aufstand haben die Einwohner der mexikanischen Gemeinde Cherán die Holzfällermafia vertrieben.",
"language": "de-CH",
@@ -248,7 +249,7 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2016-05-28T23:00:00.000Z,",
"date": "2016-05-28T23:00:00.000Z",
"ISSN": "1660-0851",
"abstractNote": "Im Gesundheitswesen wird heftig über den Sinn von teuren Tests zur Krebs-Früherkennung gestritten.",
"language": "de-CH",
@@ -1,6 +1,6 @@
{
"translatorID": "ed28758b-9c39-4e1c-af89-ce1c9202b70f",
"label": "National Gallery of Art - U.S.A.",
"label": "National Gallery of Art - USA",
"creator": "Adam Crymble",
"target": "^https?://www\\.nga\\.gov/content\\/ngaweb",
"minVersion": "1.0.0b4.r5",
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2013-06-08 13:57:52"
"lastUpdated": "2016-12-28 11:55:43"
}

/* Multiple items examples (tests don't work)
@@ -80,28 +80,28 @@ var testCases = [
"items": [
{
"itemType": "artwork",
"title": "Girl with a Flute",
"creators": [
{
"firstName": "Johannes",
"lastName": "Vermeer",
"creatorType": "artist"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"date": "probably 1665/1675",
"artworkMedium": "oil on panel",
"artworkSize": "painted surface: 20 x 17.8 cm (7 7/8 x 7 in.), framed: 39.7 x 37.5 x 5.1 cm (15 5/8 x 14 3/4 x 2 in.)",
"callNumber": "1942.9.98",
"libraryCatalog": "National Gallery of Art - U.S.A.",
"attachments": [
{
"title": "US National Gallery Snapshot",
"mimeType": "text/html"
}
],
"title": "Girl with a Flute",
"date": "probably 1665/1675",
"artworkSize": "painted surface: 20 x 17.8 cm (7 7/8 x 7 in.)\n, framed: 39.7 x 37.5 x 5.1 cm (15 5/8 x 14 3/4 x 2 in.)",
"callNumber": "1942.9.98",
"libraryCatalog": "National Gallery of Art - U.S.A.",
"artworkMedium": "oil on panel"
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-03-14 15:46:49"
"lastUpdated": "2016-12-28 12:19:19"
}

function detectWeb(doc, url) {
@@ -87,7 +87,7 @@ function load_item(responseText, url, format) {

/* and everything else */
for (var attr in metadata) {
if (!newItem[attr]) {
if (!newItem[attr] && attr!="authors") {
newItem[attr] = metadata[attr];
}
}
@@ -137,30 +137,28 @@ var testCases = [
"items": [
{
"itemType": "book",
"title": "Labor : readings on major issues / [edited by] Richard A. Lester",
"creators": [
{
"firstName": "Richard Allen",
"lastName": "Lester",
"creatorType": "author"
}
],
"notes": [],
"tags": [
"Working class",
"United States.",
"Labor unions"
],
"seeAlso": [],
"attachments": [],
"title": "Labor : readings on major issues / [edited by] Richard A. Lester",
"publisher": "Random House",
"callNumber": "331.082 L642",
"place": "New York",
"date": "New York : Random House, [1967]",
"authors": "Lester, Richard Allen, 1908-",
"callNumber": "331.082 L642",
"extra": "Bibliographical footnotes.",
"libraryCatalog": "National Library of Australia",
"shortTitle": "Labor"
"place": "New York",
"publisher": "Random House",
"shortTitle": "Labor",
"attachments": [],
"tags": [
"Labor unions -- United States.",
"Working class -- United States."
],
"notes": [],
"seeAlso": []
}
]
},
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2016-05-20 04:28:12"
"lastUpdated": "2016-12-28 12:25:50"
}

/*
@@ -127,6 +127,8 @@ function scrape(doc, url) {
if (item.numPages) {
item.numPages = extractNumPages(item.numPages);
}

item.date = ZU.strToISO(item.date);

// Add permalink
var container = doc.getElementById('preview_metadata');
@@ -147,7 +149,7 @@ var testCases = [
"itemType": "videoRecording",
"title": "Sammenslåing av BP og Amoco - Dagsrevyen 1998.12.31 (6: 9)",
"creators": [],
"date": "Desember 31, 1996",
"date": "1996-12-31",
"libraryCatalog": "National Library of Norway",
"shortTitle": "Sammenslåing av BP og Amoco - Dagsrevyen 1998.12.31 (6",
"url": "http://urn.nb.no/URN:NBN:no-nb_video_11201",
Oops, something went wrong.

0 comments on commit bd311c6

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