[Retrieve Metadata] Look for JSTOR stable URLs and convert to DOIs
Thanks to myqlarson for the suggestion. See https://forums.zotero.org/discussion/29354/1/query-limit-reached/#Item_42
This commit is contained in:
parent
b3da19e96d
commit
4bedb61aa2
1 changed files with 12 additions and 1 deletions
|
@ -75,10 +75,21 @@ var Zotero_RecognizePDF = new function() {
|
|||
return _extractText(file, MAX_PAGES).then(function(lines) {
|
||||
// Look for DOI - Use only first 80 lines to avoid catching article references
|
||||
var allText = lines.join("\n"),
|
||||
doi = Zotero.Utilities.cleanDOI(lines.slice(0,80).join('\n')),
|
||||
firstChunk = lines.slice(0,80).join('\n'),
|
||||
doi = Zotero.Utilities.cleanDOI(firstChunk),
|
||||
promise;
|
||||
Zotero.debug(allText);
|
||||
|
||||
if(!doi) {
|
||||
// Look for a JSTOR stable URL, which can be converted to a DOI by prepending 10.2307
|
||||
doi = firstChunk.match(/www.\jstor\.org\/stable\/(\S+)/i);
|
||||
if(doi) {
|
||||
doi = Zotero.Utilities.cleanDOI(
|
||||
doi[1].indexOf('10.') == 0 ? doi[1] : '10.2307/' + doi[1]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if(doi) {
|
||||
// Look up DOI
|
||||
Zotero.debug("RecognizePDF: Found DOI: "+doi);
|
||||
|
|
Loading…
Add table
Reference in a new issue