Skip to content

Commit

Permalink
Add in friendly querystring for Crossref and update VCR cassettes acc…
Browse files Browse the repository at this point in the history
…ordingly
  • Loading branch information
digitaldogsbody committed Jan 20, 2022
1 parent 590d9eb commit 8834f2c
Show file tree
Hide file tree
Showing 57 changed files with 6,295 additions and 1,859 deletions.
5 changes: 2 additions & 3 deletions app/controllers/index_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ def show
if response.status == 200
@metadata = Bolognese::Metadata.new(input: response.body.fetch("data", nil), from: "datacite_json")
else
url = "https://api.crossref.org/works/#{@doi}/transform/application/vnd.crossref.unixsd+xml"
useragent = "Mozilla/5.0 (compatible; Maremma/#{Maremma::VERSION}; +https://github.com/datacite/maremma; mailto:[email protected])"
response = Maremma.get(url, accept: "text/xml", raw: true, timeout: 2, useragent: useragent)
url = "https://api.crossref.org/works/#{@doi}/transform/application/[email protected]"
response = Maremma.get(url, accept: "text/xml", raw: true, timeout: 2)

if response.status == 200
string = response.body.fetch("data", nil)
Expand Down
2 changes: 1 addition & 1 deletion coverage/.last_run.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"result": {
"covered_percent": 69.09
"covered_percent": 93.17
}
}
Loading

0 comments on commit 8834f2c

Please sign in to comment.