Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/build
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ zip -r zoterocitationcountsmanager-${version}.xpi locale/* manifest.json bootstr
# - increase version number in all files (not just here)
# - run this script to create a new .xpi file
# - commit and push to Github
# - make a release on Github, and manually upload the new .xpi file
# - make a release on Github, and manually upload the new .xpi file
2 changes: 1 addition & 1 deletion locale/en-US/citation-counts.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ citationcounts-preferences-pane-autoretrieve-api-none =
.label = No

## Misc
citationcounts-internal-error = Internal error
citationcounts-internal-error = Internal error
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"id": "frlars21@github.com",
"update_url": "https://www.zotero.org/download/plugins/make-it-red/updates.json",
"strict_min_version": "6.999",
"strict_max_version": "7.0.*"
"strict_max_version": "7.1.*"
}
}
}
14 changes: 10 additions & 4 deletions zoterocitationcounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -527,11 +527,17 @@ ZoteroCitationCounts = {
////////////////////////////////////////////

_crossrefUrl: function (id, type) {
return `https://api.crossref.org/works/${id}/transform/application/vnd.citationstyles.csl+json`;
return `https://api.crossref.org/works/${id}`;
},

_crossrefCallback: function (response) {
return response["is-referenced-by-count"];
_crossrefCallback: async function (response) {
const count = response?.message?.["is-referenced-by-count"];

// small delay to avoid hitting Crossref rate limits when
// processing many items at once
await new Promise((r) => setTimeout(r, 500));

return count;
},

_inspireUrl: function (id, type) {
Expand All @@ -549,7 +555,7 @@ ZoteroCitationCounts = {

// The callback can be async if we want.
_semanticScholarCallback: async function (response) {
count = response["citationCount"];
const count = response["citationCount"];

// throttle Semantic Scholar so we don't reach limit.
await new Promise((r) => setTimeout(r, 3000));
Expand Down