diff --git a/OpenAlex JSON.js b/OpenAlex JSON.js index 66ed1be4a8..a392e0030d 100644 --- a/OpenAlex JSON.js +++ b/OpenAlex JSON.js @@ -8,7 +8,7 @@ "priority": 100, "inRepository": true, "translatorType": 1, - "lastUpdated": "2024-04-13 18:27:45" + "lastUpdated": "2024-07-29 14:03:58" } /* @@ -37,12 +37,12 @@ // copied from CSL JSON function parseInput() { var str, json = ""; - + // Read in the whole file at once, since we can't easily parse a JSON stream. The // chunk size here is pretty arbitrary, although larger chunk sizes may be marginally // faster. We set it to 1MB. while ((str = Z.read(1048576)) !== false) json += str; - + try { return JSON.parse(json); } @@ -55,10 +55,10 @@ function parseInput() { function detectImport() { var parsedData = parseInput(); // Z.debug(parsedData.ids) - if (parsedData && parsedData.ids && parsedData.ids.openAlex) { + if (parsedData && parsedData.ids && parsedData.ids.openalex) { return true; } - else if (parsedData && parsedData.results && parsedData.results[0].ids && parsedData.results[0].ids.openAlex) { + else if (parsedData && parsedData.results && parsedData.results[0].ids && parsedData.results[0].ids.openalex) { return true; } return false; @@ -165,11 +165,10 @@ function parseIndividual(data) { for (let tag of tags) { item.tags.push(tag.keyword); } - item.extra = "OpenAlex: " + data.ids.openAlex; + item.extra = "OpenAlex: " + data.ids.openalex; item.complete(); } - /** BEGIN TEST CASES **/ var testCases = [ { diff --git a/OpenAlex.js b/OpenAlex.js index 13ae6a8ffd..35a828e543 100644 --- a/OpenAlex.js +++ b/OpenAlex.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 12, "browserSupport": "gcsibv", - "lastUpdated": "2024-04-13 18:27:11" + "lastUpdated": "2024-07-29 14:03:50" } /* @@ -102,12 +102,12 @@ async function scrape(ids) { await translator.translate(); } - /** BEGIN TEST CASES **/ var testCases = [ { "type": "web", "url": "https://openalex.org/works?page=1&filter=default.search%3Alabor&sort=relevance_score%3Adesc", + "defer": true, "items": "multiple" }, { @@ -140,17 +140,7 @@ var testCases = [ "mimeType": "application/pdf" } ], - "tags": [ - { - "tag": "labor" - }, - { - "tag": "male-female" - }, - { - "tag": "markets" - } - ], + "tags": [], "notes": [], "seeAlso": [] } @@ -186,11 +176,7 @@ var testCases = [ "mimeType": "application/pdf" } ], - "tags": [ - { - "tag": "Reliability Estimation" - } - ], + "tags": [], "notes": [], "seeAlso": [] } @@ -199,7 +185,7 @@ var testCases = [ { "type": "search", "input": { - "openalex": "W2741809807" + "openAlex": "W2741809807" }, "items": [ { @@ -268,26 +254,7 @@ var testCases = [ "mimeType": "application/pdf" } ], - "tags": [ - { - "tag": "access" - }, - { - "tag": "articles" - }, - { - "tag": "large-scale" - }, - { - "tag": "oa" - }, - { - "tag": "open" - }, - { - "tag": "prevalence" - } - ], + "tags": [], "notes": [], "seeAlso": [] }