Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdding two types of sources to Idref.js (oatao + persee) #2057
+41
−28
Conversation
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.
This comment has been minimized.
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.
This comment has been minimized.
This comment has been minimized.
Ah thanks -- this is great! Will merge shortly |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
symac commentedNov 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 :