From e4d6563817c53e76e5451fe070cafaadc18b9d4c Mon Sep 17 00:00:00 2001 From: Sebastian Karcher Date: Tue, 19 Mar 2024 21:59:45 -0400 Subject: [PATCH] Fix OSF Preprints remove tests for preprint item type -- that's now 2 years old. --- OSF Preprints.js | 123 +++++++++++++++-------------------------------- 1 file changed, 39 insertions(+), 84 deletions(-) diff --git a/OSF Preprints.js b/OSF Preprints.js index 43cc79dd72..3318b3f981 100644 --- a/OSF Preprints.js +++ b/OSF Preprints.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2022-04-04 18:35:34" + "lastUpdated": "2024-03-20 01:58:39" } /* @@ -35,16 +35,11 @@ ***** END LICENSE BLOCK ***** */ - -const preprintType = ZU.fieldIsValidForType('title', 'preprint') - ? 'preprint' - : 'report'; - function detectWeb(doc, url) { - if (text(doc, 'h1#preprintTitle')) { - return preprintType; + if (text(doc, 'h1[data-test-preprint-title]')) { + return "preprint"; } - else if (url.includes("discover?") && getSearchResults(doc, true)) { + else if (url.includes("search?") && getSearchResults(doc, true)) { return "multiple"; } Z.monitorDOMChanges(doc.body); @@ -57,7 +52,7 @@ function getSearchResults(doc, checkOnly) { var found = false; // The Preprint search on OSF includes other preprints such as PeerJ and RePec var supportedSites = /^https?:\/\/(osf\.io|psyarxiv\.com|arabixiv\.org|biohackrxiv\.org|eartharxiv\.org|ecoevorxiv\.org|ecsarxiv\.org|edarxiv\.org|engrxiv\.org|frenxiv\.org|indiarxiv\.org|mediarxiv\.org|paleorxiv\.org)/; - var rows = doc.querySelectorAll('.search-result h4>a'); + var rows = doc.querySelectorAll('div[class*="primary-metadata-container"] h4>a'); for (let row of rows) { let href = row.href; let title = ZU.trimInternal(row.textContent); @@ -101,7 +96,7 @@ function osfAPIImport(text) { let json = JSON.parse(text); let attr = json.data.attributes; let embeds = json.data.embeds; - var item = new Zotero.Item(preprintType); + var item = new Zotero.Item("preprint"); // currently we're just doing preprints, but putting this here in case we'll want to handle different OSF // item types in the future // let type = json.data.type @@ -110,9 +105,6 @@ function osfAPIImport(text) { item.date = attr.date_published; item.publisher = embeds.provider.data.attributes.name; item.DOI = json.data.links.preprint_doi && ZU.cleanDOI(json.data.links.preprint_doi); - if (preprintType != 'preprint') { - item.extra = "type: article"; - } item.url = json.data.links.html; for (let tag of attr.tags) { item.tags.push(tag); @@ -143,14 +135,6 @@ function scrape(doc, url) { translator.setTranslator('951c027d-74ac-47d4-a107-9c3069ab7b48'); translator.setHandler('itemDone', function (obj, item) { - if (preprintType != 'preprint') { - if (item.extra) { - item.extra += "\ntype: article"; - } - else { - item.extra = "type: article"; - } - } // remove Snapshot, which is useless for OSF preprints (plus we should always get a PDF) for (let i = item.attachments.length - 1; i >= 0; i--) { if (item.attachments[i].title == "Snapshot") { @@ -162,7 +146,7 @@ function scrape(doc, url) { }); translator.getTranslatorObject(function (trans) { - trans.itemType = preprintType; + trans.itemType = "preprint"; trans.doWeb(doc, url); }); } @@ -172,7 +156,7 @@ function scrape(doc, url) { var testCases = [ { "type": "web", - "url": "https://psyarxiv.com/nx2b4/", + "url": "https://osf.io/preprints/psyarxiv/nx2b4", "defer": true, "items": [ { @@ -190,33 +174,19 @@ var testCases = [ "creatorType": "author" } ], - "date": "2020-05-05T19:14:05.245Z", + "date": "2020-05-05", "DOI": "10.31234/osf.io/nx2b4", - "abstractNote": "We introduce a new Dutch receptive vocabulary test, the Dutch auditory & image vocabulary test (DAIVT). The test is multiple choice and assesses vocabulary knowledge for spoken words. The measure has an online format, has free access, and allows easy data collection. The test was developed with the intent to enable testing for research purposes with university students. This paper describes the test construction. We cover three phases: 1) collecting stimulus materials and developing the test’s first version, 2) an exploratory item-analysis on the first draft (n= 93), and 3) validating the test (both the second and the final version) by comparing it to two existing tests (n= 270, n= 157). The results indicate that the test is reliable and correlates well with existing Dutch receptive vocabulary tests (convergent validity). The final version of the DAIVT comprises 90 test items and 1 practice item. It can be used freely for research purposes.", + "abstractNote": "We introduce a new Dutch receptive vocabulary test, the Dutch auditory & image vocabulary test (DAIVT). The test is multiple choice and assesses vocabulary knowledge for spoken words. The measure has an online format, has free access, and allows easy data collection. The test was developed with the intent to enable testing for research purposes with university students. This paper describes the test construction. We cover three phases: 1) collecting stimulus materials and developing the test’s first version, 2) an exploratory item-analysis on the first draft (n= 93), and 3) validating the test (both the second and the final version) by comparing it to two existing tests (n= 270, n= 157). The results indicate that the test is reliable and correlates well with existing Dutch receptive vocabulary tests (convergent validity). The final version of the DAIVT comprises 90 test items and 1 practice item. It can be used freely for research purposes.", "language": "en-us", "libraryCatalog": "OSF Preprints", - "repository": "PsyArXiv", + "repository": "OSF", "shortTitle": "The Dutch Auditory & Image Vocabulary Test (DAIVT)", - "url": "https://psyarxiv.com/nx2b4/", - "attachments": [ - { - "title": "Full Text PDF", - "mimeType": "application/pdf" - } - ], + "url": "https://osf.io/nx2b4", + "attachments": [], "tags": [ - { - "tag": "Cognitive Psychology" - }, { "tag": "Dutch vocabulary" }, - { - "tag": "Language" - }, - { - "tag": "Social and Behavioral Sciences" - }, { "tag": "individual differences" }, @@ -240,7 +210,7 @@ var testCases = [ }, { "type": "web", - "url": "https://osf.io/b2xmp/", + "url": "https://osf.io/preprints/osf/b2xmp", "defer": true, "items": [ { @@ -303,68 +273,33 @@ var testCases = [ "creatorType": "author" } ], - "date": "2020-04-29T12:19:21.907Z", + "date": "2020-04-29", "DOI": "10.31219/osf.io/b2xmp", "abstractNote": "Current demand for SARS-CoV-2 testing is straining material resource and labor capacity around the globe. As a result, the public health and clinical community are hindered in their ability to monitor and contain the spread of COVID-19. Despite broad consensus that more testing is needed, pragmatic guidance towards realizing this objective has been limited. This paper addresses this limitation by proposing a novel and geographically agnostic framework (‘the 4Ps Framework) to guide multidisciplinary, scalable, resource-efficient, and achievable efforts towards enhanced testing capacity. The 4Ps (Prioritize, Propagate, Partition, and Provide) are described in terms of specific opportunities to enhance the volume, diversity, characterization, and implementation of SARS-CoV-2 testing to benefit public health. Coordinated deployment of the strategic and tactical recommendations described in this framework have the potential to rapidly expand available testing capacity, improve public health decision-making in response to the COVID-19 pandemic, and/or to be applied in future emergent disease outbreaks.", "language": "en-us", "libraryCatalog": "OSF Preprints", - "repository": "OSF Preprints", + "repository": "OSF", "shortTitle": "‘All In’", - "url": "https://osf.io/b2xmp/", - "attachments": [ - { - "title": "Full Text PDF", - "mimeType": "application/pdf" - } - ], + "url": "https://osf.io/b2xmp", + "attachments": [], "tags": [ { "tag": "COVID-19" }, - { - "tag": "Diseases" - }, - { - "tag": "Health Policy" - }, - { - "tag": "Life Sciences" - }, - { - "tag": "Medicine and Health Sciences" - }, - { - "tag": "Microbiology" - }, { "tag": "Pandemic" }, - { - "tag": "Public Affairs" - }, { "tag": "Public Health" }, - { - "tag": "Public Policy and Public Administration" - }, { "tag": "RT-PCR" }, { "tag": "SARS-CoV-2" }, - { - "tag": "Social and Behavioral Sciences" - }, { "tag": "Virologic Testing" - }, - { - "tag": "Virology" - }, - { - "tag": "Virus Diseases" } ], "notes": [], @@ -374,8 +309,28 @@ var testCases = [ }, { "type": "web", - "url": "https://osf.io/preprints/discover?provider=OSFORAgriXivORSocArXiv&q=testing", + "url": "https://osf.io/preprints/socarxiv/j7qta", + "defer": true, + "items": [ + { + "itemType": "preprint", + "title": "SocArXiv Papers | The Reliability of Replications: A Study in Computational Reproductions", + "creators": [], + "language": "en-us", + "libraryCatalog": "OSF Preprints", + "shortTitle": "SocArXiv Papers | The Reliability of Replications", + "url": "https://osf.io/preprints/socarxiv/j7qta", + "attachments": [], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] + }, + { + "type": "web", "defer": true, + "url": "https://osf.io/search?activeFilters=%5B%5D&q=metascience&resourceType=Preprint&sort=-relevance&view_only=", "items": "multiple" } ]