Skip to content
Please note that GitHub no longer supports your web browser.

We recommend upgrading to the latest Google Chrome or Firefox.

Learn more
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

Adding two types of sources to Idref.js (oatao + persee) #2057

Merged
merged 3 commits into from Nov 21, 2019

Conversation

@symac
Copy link
Contributor

symac commented Nov 16, 2019

IDref is a website describing authorities and getting bib records from multiple sources where the authority exists. This PR makes the translators compatible with more sources :

@symac symac changed the title Adding two types of references (oatao + persee) Adding two types of sources to Idref.js (oatao + persee) Nov 16, 2019
Idref.js Outdated
@@ -53,7 +53,7 @@ function getSearchResults(doc, checkOnly) {
// We need to replace the http://www.sudoc.fr/XXXXXX links are they are redirects and aren't handled correctly from subtranslator
href = href.replace(/http:\/\/www\.sudoc\.fr\/(.*)$/, "http://www.sudoc.abes.fr/xslt/DB=2.1//SRCH?IKT=12&TRM=$1");

if ((href.includes("www.sudoc.abes.fr")) || (href.includes("archives-ouvertes")) || (href.includes("catalogue.bnf.fr")) || (href.includes("www.theses.fr")) || (href.includes("pub.orcid.org"))) {
if ((href.includes("www.sudoc.abes.fr")) || (href.includes("archives-ouvertes")) || (href.includes("catalogue.bnf.fr")) || (href.includes("www.theses.fr")) || (href.includes("pub.orcid.org")) || (href.includes("www.persee.fr")) || (href.includes("oatao.univ-toulouse.fr"))) {

This comment has been minimized.

Copy link
@adam3smith

adam3smith Nov 17, 2019

Collaborator

This is fine, but I'm wondering if it'd be possible to make sure href is just the host name of the redirected page and then test them against an array along the lines of ["catalogue.bnf.fr", "www.sudoc.abes.fr"...].includes(href)

This would perform much better and imo be a lot more legible, but given that we're still testing against a relatively short list of strings, the current version is fine -- just let me know if you think the above is viable and you're interested in working on it or not.

@symac symac force-pushed the symac:master branch from 13989fc to efb8e78 Nov 21, 2019
@adam3smith

This comment has been minimized.

Copy link
Collaborator

adam3smith commented Nov 21, 2019

Ah thanks -- this is great! Will merge shortly

@adam3smith adam3smith merged commit baf9e3f into zotero:master Nov 21, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.