Skip to content
Permalink
Browse files

Fix author names in NewsnetTamedia.js (#1642)

  • Loading branch information...
zuphilip committed Apr 29, 2018
1 parent fbbef89 commit 94ea45902792b86ea0f14de4d3c77c3dca2943d3
Showing with 37 additions and 2 deletions.
  1. +37 −2 NewsnetTamedia.js
@@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2018-04-18 06:55:25"
"lastUpdated": "2018-04-29 11:03:04"
}

/*
@@ -95,7 +95,9 @@ function scrape(doc, url) {
if (!authors || authors.length===0) authors = ZU.xpath(doc, '(//section[contains(@class, "article-info")])[1]//a[contains(@class, "article-author")]');
if (authors) {
for (let i=0; i<authors.length; i++) {
item.creators.push(ZU.cleanAuthor(authors[i].textContent, "author"));
// Delete "Par" = From in authors name
let author = authors[i].textContent.replace(/^Par /, '');
item.creators.push(ZU.cleanAuthor(author, "author"));
}
}

@@ -410,6 +412,7 @@ var testCases = [
"creatorType": "author"
}
],
"date": "2018-04-18",
"ISSN": "1010-2248",
"abstractNote": "Dans 64 jours, le pape François sera en visite à Genève. Discrètement, sa garde rapprochée a repéré les lieux cette semaine.",
"language": "fr",
@@ -469,6 +472,38 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.tdg.ch/editorial/surveillance-assures-reveil-tardif/story/27369648",
"items": [
{
"itemType": "newspaperArticle",
"title": "Surveillance des assurés: un réveil tardif",
"creators": [
{
"firstName": "Sophie",
"lastName": "Simon",
"creatorType": "author"
}
],
"date": "2018-04-27",
"ISSN": "1010-2248",
"language": "fr",
"libraryCatalog": "www.tdg.ch",
"publicationTitle": "TDG",
"shortTitle": "Surveillance des assurés",
"url": "https://www.tdg.ch/editorial/surveillance-assures-reveil-tardif/story/27369648",
"attachments": [
{
"title": "Snapshot"
}
],
"tags": [],
"notes": [],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

0 comments on commit 94ea459

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