Skip to content

Commit

Permalink
more readable and fix sequential execution
Browse files Browse the repository at this point in the history
  • Loading branch information
socheres committed Dec 7, 2020
1 parent 10560af commit e482375
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 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-04 14:05:29"
"lastUpdated": "2020-12-07 08:53:30"
}

/*
Expand Down Expand Up @@ -170,7 +170,12 @@ 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 (reviewType && reviewType.match(/other/i) && item.issue === '5' && item.ISSN === '0142-064X' || item.ISSN === '0309-0892') item.tags.push('Book Review') && item.notes.push({note: "Booklist:" + item.date.match(/\d{4}$/)});
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++) {
Expand All @@ -180,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

0 comments on commit e482375

Please sign in to comment.