Skip to content

Commit

Permalink
Merge pull request #147 from socheres/master
Browse files Browse the repository at this point in the history
  • Loading branch information
jriedl authored Dec 7, 2020
2 parents b898183 + e482375 commit 02a165b
Showing 1 changed file with 93 additions and 2 deletions.
95 changes: 93 additions & 2 deletions SAGE Journals.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2020-12-03 10:32:23"
"lastUpdated": "2020-12-07 08:53:30"
}

/*
Expand Down Expand Up @@ -168,6 +168,15 @@ function scrape(doc, url) {
}
}
}
//ubtue: add tag "Book Review" in every issue 5 of specific journals if the dc.Type is "others"
let reviewType = ZU.xpathText(doc, '//meta[@name="dc.Type"]/@content');
if (item.ISSN === '0142-064X' || item.ISSN === '0309-0892') {
if (reviewType && reviewType.match(/other/i) && item.issue === '5') {
item.tags.push('Book Review');
item.notes.push({note: "Booklist:" + item.date.match(/\d{4}$/)});
}
}

// Workaround while Sage hopefully fixes RIS for authors
for (let i = 0; i < item.creators.length; i++) {
if (!item.creators[i].firstName) {
Expand All @@ -176,7 +185,6 @@ function scrape(doc, url) {
item.creators[i] = ZU.cleanAuthor(item.creators[i].lastName, type, comma);
}
}

// scrape tags
if (!item.tags || item.tags.length === 0) {
var embedded = ZU.xpathText(doc, '//meta[@name="keywords"]/@content');
Expand Down Expand Up @@ -693,6 +701,89 @@ var testCases = [
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://journals.sagepub.com/doi/full/10.1177/0142064X20928711",
"items": [
{
"itemType": "journalArticle",
"title": "1. New Testament General",
"creators": [],
"date": "August 1, 2020",
"DOI": "10.1177/0142064X20928711",
"ISSN": "0142-064X",
"abstractNote": ", , ,",
"issue": "5",
"journalAbbreviation": "Journal for the Study of the New Testament",
"language": "en",
"libraryCatalog": "SAGE Journals",
"pages": "1-3",
"publicationTitle": "Journal for the Study of the New Testament",
"url": "https://doi.org/10.1177/0142064X20928711",
"volume": "42",
"attachments": [
{
"title": "SAGE PDF Full Text",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "Book Review"
}
],
"notes": [
{
"note": "<p>doi: 10.1177/0142064X20928711</p>"
}
],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://journals.sagepub.com/doi/full/10.1177/0142064X20928711",
"items": [
{
"itemType": "journalArticle",
"title": "1. New Testament General",
"creators": [],
"date": "August 1, 2020",
"DOI": "10.1177/0142064X20928711",
"ISSN": "0142-064X",
"abstractNote": ", , ,",
"issue": "5",
"journalAbbreviation": "Journal for the Study of the New Testament",
"language": "en",
"libraryCatalog": "SAGE Journals",
"pages": "1-3",
"publicationTitle": "Journal for the Study of the New Testament",
"url": "https://doi.org/10.1177/0142064X20928711",
"volume": "42",
"attachments": [
{
"title": "SAGE PDF Full Text",
"mimeType": "application/pdf"
}
],
"tags": [
{
"tag": "Book Review"
}
],
"notes": [
{
"note": "<p>doi: 10.1177/0142064X20928711</p>"
},
{
"note": "Booklist:2020"
}
],
"seeAlso": []
}
]
}
]
/** END TEST CASES **/

0 comments on commit 02a165b

Please sign in to comment.