Skip to content

Commit

Permalink
Handle missing Inspire citation counts
Browse files Browse the repository at this point in the history
  • Loading branch information
eschnett committed Sep 29, 2020
1 parent 4a575e0 commit a09cfcf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Code for this extension is based on the [Zotero DOI
- Run Zotero (version 5.x)
- Go to `Tools -> Add-ons`
- `Install Add-on From File`
- Choose the file `zotero-citationcounts-0.1.3.xpi`
- Choose the file `zotero-citationcounts-0.1.4.xpi`
- Restart Zotero

## License
Expand Down
9 changes: 7 additions & 2 deletions chrome/content/scripts/zoterocitationcounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,14 @@ async function getInspireCount(item, idtype) {
} else if (idtype == 'arxiv') {
const arxiv = item.getField('url'); // check URL for arXiv id
const patt = /(?:arxiv.org[/]abs[/]|arXiv:)([a-z.-]+[/]\d+|\d+[.]\d+)/i;
doi = patt.exec(arxiv)[1];
const m = patt.exec(arxiv);
if (!m) {
// No arxiv id found
return -1;
}
doi = m[1];
} else {
// Error
// Internal error
return -1;
}
if (!doi) {
Expand Down
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
RDF:about="urn:mozilla:install-manifest"
em:id="[email protected]"
em:name="Zotero Citation Counts Manager"
em:version="0.1.3"
em:version="0.1.4"
em:type="2"
em:creator="Erik Schnetter"
em:description="Automatically fetch and update citation counts"
Expand Down
4 changes: 2 additions & 2 deletions update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<rdf:Seq>
<rdf:li>
<rdf:Description>
<em:version>0.1.3</em:version>
<em:version>0.1.4</em:version>
<em:targetApplication>
<rdf:Description>
<em:id>[email protected]</em:id>
<em:minVersion>5.0</em:minVersion>
<em:maxVersion>5.*</em:maxVersion>
<em:updateLink>https://github.com/eschnett/zotero-citationcounts/releases/download/v0.1.3/zotero-citationcounts-0.1.3.xpi</em:updateLink>
<em:updateLink>https://github.com/eschnett/zotero-citationcounts/releases/download/v0.1.4/zotero-citationcounts-0.1.4.xpi</em:updateLink>
</rdf:Description>
</em:targetApplication>
</rdf:Description>
Expand Down

0 comments on commit a09cfcf

Please sign in to comment.