-
Notifications
You must be signed in to change notification settings - Fork 770
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Zenodo] Prevent mis-importing software as report #1578
Changes from 3 commits
6d94ac5
7ebc987
b2d7d61
d255ec5
2b436be
fa968f4
3434076
dcce9bc
cb3ca57
0c46a5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"inRepository": true, | ||
"translatorType": 4, | ||
"browserSupport": "gcsibv", | ||
"lastUpdated": "2018-01-22 21:59:40" | ||
"lastUpdated": "2018-03-07 14:55:24" | ||
} | ||
|
||
/* | ||
|
@@ -195,6 +195,11 @@ function scrape(doc, url) { | |
|
||
if (item.itemType == "document" && zoteroType[type]) { | ||
item.itemType = zoteroType[type]; | ||
|
||
//undo the fix for non-existent CSL types, if Zotero supports the original itemType | ||
if (detectWeb(doc, url) == "computerProgram") { | ||
item.itemType = "computerProgram" | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we delete the first introduction of the variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the latter one seems not necessarily anymore. We certainly still need the first one. |
||
item.itemID = ""; | ||
item.complete(); | ||
|
@@ -469,6 +474,61 @@ var testCases = [ | |
"seeAlso": [] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "web", | ||
"url": "https://zenodo.org/record/1048320", | ||
"items": [ | ||
{ | ||
"itemType": "computerProgram" | ||
"creators": [ | ||
{ | ||
"lastName": "Carl Boettiger" | ||
"firstName": "" | ||
"creatorType": "author" | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rerun the tests should yield some |
||
{ | ||
"lastName": "Maëlle Salmon" | ||
"firstName": "" | ||
"creatorType": "author" | ||
} | ||
{ | ||
"lastName": "Noam Ross" | ||
"firstName": "" | ||
"creatorType": "author" | ||
} | ||
{ | ||
"lastName": "Arfon Smith" | ||
"firstName": "" | ||
"creatorType": "author" | ||
} | ||
{ | ||
"lastName": "Anna Krystalli" | ||
"firstName": "" | ||
"creatorType": "author" | ||
} | ||
] | ||
"notes": [] | ||
"tags": [] | ||
"seeAlso": [] | ||
"attachments": [ | ||
{ | ||
"title": "Zenodo Snapshot" | ||
"mimeType": "text/html" | ||
} | ||
] | ||
"title": "ropensci/codemetar: codemetar: Generate CodeMeta Metadata for R Packages" | ||
"publisher": "Zenodo" | ||
"abstractNote": "an R package for generating and working with codemeta" | ||
"date": "2017-11-13" | ||
"extra": "DOI: 10.5281/zenodo.1048320" | ||
"url": "https://zenodo.org/record/1048320" | ||
"libraryCatalog": "Zenodo" | ||
"accessDate": "2018-03-07T13:45:35Z" | ||
"shortTitle": "ropensci/codemetar" | ||
"company": "Zenodo" | ||
} | ||
] | ||
} | ||
] | ||
/** END TEST CASES **/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what would happen if we replace this whole thing, including l. 197 by
item.itemType = detectWeb(doc, url)
That seems like a cleaner solution, provided our detect function is good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could the
var zoteroType
block be removed as well, then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exactly, yes