Skip to content

Commit

Permalink
Change to match_doi
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastinSanty committed Jun 21, 2018
1 parent bb67a6e commit 17c8e14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/DataCite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 2 additions & 6 deletions src/DataDepsGenerators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 17c8e14

Please sign in to comment.