From 02b3a659a951a6611eed59ad5078d5889119bedd Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 21 May 2019 19:12:05 -0700 Subject: better JALC DOI de-mangling --- python/fatcat_tools/importers/jalc.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'python/fatcat_tools/importers') diff --git a/python/fatcat_tools/importers/jalc.py b/python/fatcat_tools/importers/jalc.py index 1e1c9032..24da60ea 100644 --- a/python/fatcat_tools/importers/jalc.py +++ b/python/fatcat_tools/importers/jalc.py @@ -90,10 +90,19 @@ class JalcImporter(EntityImporter): doi = None if record.doi: doi = record.doi.string.lower().strip() + if doi.startswith('http://dx.doi.org/'): + doi = doi.replace('http://dx.doi.org/', '') + elif doi.startswith('https://dx.doi.org/'): + doi = doi.replace('https://dx.doi.org/', '') + elif doi.startswith('http://doi.org/'): + doi = doi.replace('http://doi.org/', '') + elif doi.startswith('https://doi.org/'): + doi = doi.replace('https://doi.org/', '') if not doi.startswith('10.'): sys.stderr.write("bogus JALC DOI: {}\n".format(doi)) doi = None - return None + if not doi: + return None contribs = [] people = record.find_all("Person") -- cgit v1.2.3