Sha256: 3f4e900d02f973e27bd072f1baa6f9fe89b775b0321e620953acdf26be4159d7
Contents?: true
Size: 922 Bytes
Versions: 138
Compression:
Stored size: 922 Bytes
Contents
module Bolognese class Orcid < Metadata include Bolognese::Utils # def get_orcid_metadata(orcid, options = {}) # return {} if orcid.blank? # url = "https://pub.orcid.org/v2.0/#{orcid}/person" # response = Maremma.get(url, options.merge(accept: "json")) # name = response.body.fetch("data", {}).fetch("name", nil) # return { "errors" => 'Resource not found.' } unless name.present? # author = { "family" => name.fetch("family-name", {}).fetch("value", nil), # "given" => name.fetch("given-names", {}).fetch("value", nil) } # { "author" => [author], # "title" => "ORCID record for #{[author.fetch('given', nil), author.fetch('family', nil)].compact.join(' ')}", # "container-title" => "ORCID Registry", # "issued" => Time.now.year.to_s, # "URL" => orcid_as_url(orcid), # "type" => 'entry' } # end end end
Version data entries
138 entries across 138 versions & 1 rubygems