Skip to content
Permalink
Browse files

Fixes YZ (zotero#1334)

* Update tests in zotero.org.js
* Update tests in ZIPonline.js
The scraping of the last page will work for subscribers only.
Thus, the tests are updated to reflect the situation for the
automatic testing.
* Update tests in YouTube.js
The last example (now deleted) is showing a page with
   "This video contains content from [Merlin] IDOL Distribution,
who has blocked it on copyright grounds."
and therefore also the metadata extraction does not work
anymore.
* Update Ynet.js
  • Loading branch information...
zuphilip authored and adam3smith committed Jun 23, 2017
1 parent 0133798 commit 9d54768f550ccc1a16d345adf0a335ad5925e8f9
Showing with 29 additions and 120 deletions.
  1. +12 −12 Ynet.js
  2. +1 −46 YouTube.js
  3. +3 −3 ZIPonline.js
  4. +13 −59 zotero.org.js
24 Ynet.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2015-08-15 17:25:20"
"lastUpdated": "2017-06-17 15:34:41"
}

/**
@@ -43,18 +43,18 @@ function doWeb(doc, url) {
var abstract = ZU.xpathText(doc, '//div[@class="art_header_sub_title"]');
if (!abstract) abstract = ZU.xpathText(doc, '//meta[@property="og:description"]/@content');
item.abstractNote = abstract;

var author = ZU.xpathText(doc, '//div[@class="art_header_footer"]//a');
if (author) {
item.creators.push(Zotero.Utilities.cleanAuthor(author, 'author'));

var json = ZU.xpathText(doc, '//script[@type="application/ld+json"]');
var data = JSON.parse(json);
if (data) {
if (data.author) {
item.creators.push(Zotero.Utilities.cleanAuthor(data.author.name, 'author'));
}
if (data.datePublished) {
item.date = ZU.strToISO(data.datePublished);
}
}

var kakyDate = ZU.xpathText(doc, '//meta[@property="vr:published_time"]/@content');
var dateSplit = /([0-9]{2})\.([0-9]{2})\.([0-9]{2})$/.exec(kakyDate);
if(dateSplit) {
// it is tricky but should work
item.date = ['20'+dateSplit[3], dateSplit[2], dateSplit[1]].join('-');
}
item.complete();
}
/** BEGIN TEST CASES **/
@@ -87,4 +87,4 @@ var testCases = [
]
}
]
/** END TEST CASES **/
/** END TEST CASES **/
@@ -132,7 +132,7 @@ var testCases = [
"date": "2007-01-01",
"abstractNote": "Zotero is a free, easy-to-use research tool that helps you gather and organize resources (whether bibliography or the full text of articles), and then lets you to annotate, organize, and share the results of your research. It includes the best parts of older reference manager software (like EndNote)—the ability to store full reference information in author, title, and publication fields and to export that as formatted references—and the best parts of modern software such as del.icio.us or iTunes, like the ability to sort, tag, and search in advanced ways. Using its unique ability to sense when you are viewing a book, article, or other resource on the web, Zotero will—on many major research sites—find and automatically save the full reference information for you in the correct fields.",
"libraryCatalog": "YouTube",
"runningTime": "173 seconds",
"runningTime": "172 seconds",
"url": "https://www.youtube.com/watch?v=pq94aBrc0pY",
"attachments": [],
"tags": [
@@ -167,51 +167,6 @@ var testCases = [
"type": "web",
"url": "http://www.youtube.com/user/Zoteron",
"items": "multiple"
},
{
"type": "web",
"url": "https://www.youtube.com/watch?v=9-cM5FLTGhU",
"items": [
{
"itemType": "videoRecording",
"title": "The Great Dictator - Speech to Humanity | HD",
"creators": [
{
"lastName": "EMS co.",
"creatorType": "author",
"fieldMode": 1
}
],
"date": "2013-07-24",
"abstractNote": "© United Artists, All Right Reserved.\n\nAudio Version with Music by Hans Zimmer: http://snd.sc/1dLCpZI\n\nThe final scene of \"The Great Dictator\" where Charlie Chaplin does his speech to humanity to a world at war. Relevant today as in the past.\n\nI'm sorry, but I don't want to be an Emperor, that's not my business.\nI don't want to rule or conquer anyone. I should like to help everyone if possible, Jew, gentile, black man and white.\nWe all want to help one another, human beings are like that. We all want to live by each other's happiness, not by each other's misery. We don't want to hate and despise one another.\nIn this world there is room for everyone and the earth is rich and can provide for everyone.\nThe way of life can be free and beautiful but we have lost the way.\nGreed has poisoned men's souls, has barricaded the world with hate, has goose-stepped us into misery and bloodshed. We have developed speed but we have shut ourselves in.\nMachinery that gives abundance has left us in want, our knowledge has made us cynical, our cleverness hard and unkind.\nWe think too much and feel too little\nMore than machinery we need humanity, more than cleverness we need kindness and gentleness; without these qualities, life will be violent and all will be lost.\nThe aeroplane and the radio have brought us closer together, the very nature of these inventions cries out for the goodness in men, cries out for universal brotherhood for the unity of us all. \nEven now my voice is reaching millions throughout the world; millions of despairing men, women and little children, victims of a system that makes men torture and imprison innocent people.\nTo those who can hear me I say \"Do not despair\".\nThe misery that is now upon us is but the passing of greed, the bitterness of men who fear the way of human progress.\nThe hate of men will pass and dictators die and the power they took from the people, will return to the people and so long as men die liberty will never perish.\nSoldiers! Don't give yourselves to brutes, men who despise you and enslave you, who regiment your lives, tell you what to do, what to think, what to feel!\nWho drill you, diet you, treat you like cattle, use you as cannon fodder!\nDon't give yourselves to these unnatural men!\nMachine men, with machine minds and machine hearts. You are not machines! You are not cattle! You are men!\nYou have the love of humanity in your hearts, you don't hate, only the unloved hate. The unloved and the unnatural.\nSoldiers, don't fight for slavery, fight for liberty!\nIn the seventeenth chapter of Saint Luke it is written: \"The kingdom of God is within man\". Not one man, nor a group of men, but in all men; in you!\nYou, the people have the power, the power to create machines, the power to create happiness. You, the people have the power to make this life free and beautiful, to make this life a wonderful adventure, then in the name of democracy let's use that power, let us all unite! \nLet us fight for a new world, a decent world that will give men a chance to work, that will give you the future and old age and security. By the promise of these things, brutes have risen to power, but they lie. They do not fulfil their promise, they never will.\nDictators free themselves but they enslave the people.\nNow let us fight to fulfill that promise, let us fight to free the world, to do away with national barriers, do away with greed, with hate and intolerance.\nLet us fight for a world of reason, a world where science and progress will lead to all men's happiness.\nSoldiers! In the name of democracy, let us all unite!\n\nThe Great Dictator is a 1940 American comedy-drama film starring, written, produced, scored, and directed by Charlie Chaplin, following the tradition of many of his other films. Having been the only Hollywood filmmaker to continue to make silent films well into the period of sound films, this was Chaplin's first true talking picture as well as his most commercially successful film. (Wikipedia)",
"libraryCatalog": "YouTube",
"runningTime": "423 seconds",
"url": "https://www.youtube.com/watch?v=9-cM5FLTGhU",
"attachments": [],
"tags": [
"1940",
"Chaplin",
"Charlie Chaplin",
"Charlie Chaplin (Author)",
"Dictator",
"Great",
"HD",
"High-definition Video (Film Format)",
"Hope",
"Humanity",
"Paulette Goddard",
"Peace",
"Speech",
"Speech to Humanity",
"The Great Dictator",
"The Great Dictator (Film)",
"United Artists",
"War"
],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/
@@ -180,7 +180,7 @@ var testCases = [
"journalAbbreviation": "ZIP",
"language": "de",
"libraryCatalog": "www.zip-online.de",
"pages": "112–119",
"pages": "112",
"publicationTitle": "Zeitschrift für Wirtschaftsrecht",
"url": "https://www.zip-online.de/heft-3-2017/zip-2017-112-die-wohnimmobilienkreditrichtlinie-und-ihre-umsetzung-in-deutschland/",
"attachments": [
@@ -215,7 +215,7 @@ var testCases = [
"journalAbbreviation": "ZIP",
"language": "de",
"libraryCatalog": "www.zip-online.de",
"pages": "1512–1519",
"pages": "1512",
"publicationTitle": "Zeitschrift für Wirtschaftsrecht",
"url": "https://www.zip-online.de/heft-23-24-1987/zip-1987-1512-massenentlassung-und-einhaltung-von-kuendigungsterminen/",
"attachments": [
@@ -242,7 +242,7 @@ var testCases = [
"court": "OLG Nürnberg",
"docketNumber": "8 U 2259/15",
"extra": "Urt.",
"firstPage": "19–21",
"firstPage": "19",
"language": "de",
"reporter": "ZIP",
"reporterVolume": "2017",
@@ -125,92 +125,46 @@ function doWeb(doc, url) {
var testCases = [
{
"type": "web",
"url": "https://www.zotero.org/groups/all_things_zotero/items/itemKey/HXTTNJGD",
"url": "https://www.zotero.org/groups/729/all_things_zotero/items/itemKey/HXTTNJGD",
"defer": true,
"items": [
{
"itemType": "journalArticle",
"title": "Expert Searching, Zotero: A New Breed of Search Tool",
"creators": [
{
"creatorType": "author",
"firstName": "Mark",
"lastName": "Desirto"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"attachments": [],
"title": "Expert Searching, Zotero: A New Bread of Search Tool",
"publicationTitle": "Medical Library Association Newsletter",
"date": "April 2007",
"callNumber": "0000",
"extra": "Cited by 0000"
}
]
},
{
"type": "web",
"url": "https://www.zotero.org/marksample/items/collectionKey/5RN69IBP/itemKey/58VT7DAA",
"defer": true,
"items": [
{
"itemType": "book",
"creators": [
{
"creatorType": "author",
"firstName": "Mark",
"lastName": "Osteen"
}
],
"notes": [],
"tags": [],
"seeAlso": [],
"extra": "00000 \nCited by 0000",
"publicationTitle": "Medical Library Association Newsletter",
"attachments": [],
"title": "American Magic and Dread: Don DeLillo’s Dialogue with Culture",
"place": "Philadelphia",
"publisher": "University of Pennsylvania Press",
"date": "2000",
"ISBN": "0812235517",
"shortTitle": "American Magic"
"tags": [],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.zotero.org/groups/all_things_zotero/items",
"items": "multiple",
"defer": true
"defer": true,
"items": "multiple"
},
{
"type": "web",
"url": "https://www.zotero.org/groups/all_things_zotero/items/collectionKey/XX99JMW8",
"items": "multiple",
"defer": true
},
{
"type": "web",
"url": "https://www.zotero.org/marksample/items",
"items": "multiple",
"defer": true
},
{
"type": "web",
"url": "https://www.zotero.org/marksample/items/collectionKey/5RN69IBP",
"items": "multiple",
"defer": true
},
{
"type": "web",
"url": "https://www.zotero.org/marksample/items/collection/5RN69IBP",
"items": "multiple",
"defer": true
"defer": true,
"items": "multiple"
},
{
"type": "web",
"url": "https://www.zotero.org/groups/devtesting/items/tag/tag2",
"items": "multiple",
"defer": true
"defer": true,
"items": "multiple"
}
]
/** END TEST CASES **/

0 comments on commit 9d54768

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