@@ -1442,6 +1442,26 @@ const makeMDPIPaper = async (url) => {
1442
1442
return { author, bibtex, id, key, note, pdfLink, title, venue, year, doi } ;
1443
1443
} ;
1444
1444
1445
+ const makeOUPPaper = async ( url ) => {
1446
+ url = noParamUrl ( url ) ;
1447
+ const resourceId = url . split ( "/" ) . last ( ) ;
1448
+ let bibtex = await fetchText (
1449
+ `https://academic.oup.com/Citation/Download?resourceId=${ resourceId } &resourceType=3&citationFormat=2`
1450
+ ) ;
1451
+ const paper = bibtexToObject ( bibtex ) ;
1452
+ delete paper . abstract ;
1453
+ bibtex = bibtexToString ( paper ) ;
1454
+ let { title, year, author, journal, doi, citationKey, eprint } = paper ;
1455
+ author = flipAndAuthors ( author ) ;
1456
+ const venue = journal ;
1457
+ const note = `Published @ ${ venue } (${ year } )` ;
1458
+ const key = citationKey ;
1459
+ const num = url . split ( "https://academic.oup.com/" ) [ 1 ] . split ( "/" ) . slice ( 2 ) . join ( "" ) ;
1460
+ const id = `OUP-${ year } _${ miniHash ( num ) } ` ;
1461
+ const pdfLink = eprint ?. replaceAll ( "\\" , "" ) ?? url ;
1462
+
1463
+ return { author, bibtex, id, key, note, pdfLink, title, venue, year, doi } ;
1464
+ } ;
1445
1465
// -------------------------------
1446
1466
// ----- PREPRINT MATCHING -----
1447
1467
// -------------------------------
@@ -1898,6 +1918,11 @@ const makePaper = async (is, url, tab = false) => {
1898
1918
if ( paper ) {
1899
1919
paper . source = "mdpi" ;
1900
1920
}
1921
+ } else if ( is . oup ) {
1922
+ paper = await makeOUPPaper ( url ) ;
1923
+ if ( paper ) {
1924
+ paper . source = "oup" ;
1925
+ }
1901
1926
} else {
1902
1927
throw new Error ( "Unknown paper source: " + JSON . stringify ( { is, url } ) ) ;
1903
1928
}
0 commit comments