diff --git a/src/DataCite.jl b/src/DataCite.jl index 8169dd5..21c208b 100644 --- a/src/DataCite.jl +++ b/src/DataCite.jl @@ -45,7 +45,7 @@ end function mainpage_url(repo::DataCite, dataname) try - identifier = check_dois(dataname) + identifier = match_doi(dataname) url = base_url(repo) * identifier JSON.parse(text_only(getpage(url).root))["data"], url catch ErrorException diff --git a/src/DataDepsGenerators.jl b/src/DataDepsGenerators.jl index b94389b..d8bb4d9 100644 --- a/src/DataDepsGenerators.jl +++ b/src/DataDepsGenerators.jl @@ -3,11 +3,7 @@ using Gumbo, Cascadia, AbstractTrees using Suppressor using JSON -<<<<<<< HEAD -export generate, UCI, GitHub, DataDryad, DataOneV1, DataOneV2, CKAN -======= -export generate, UCI, GitHub, DataDryadWeb, DataDryadAPI, DataOneV2, CKAN, DataCite ->>>>>>> Add DataCite API +export generate, UCI, GitHub, DataDryad, DataOneV1, DataOneV2, CKAN, DataCite abstract type DataRepo end @@ -118,7 +114,7 @@ function format_papers(authors::Vector, year::String, name::String, link::String join(authors, ", ") * " ($year). " * name * " " * link end -function check_dois(uri::String) +function match_doi(uri::String) identifier = match(r"\b(10[.][0-9]{4,}(?:[.][0-9]+)*\/(?:(?![\"&\'<>])\S)+)\b", uri).match return identifier end