Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (18 sloc) 0.48 kB
require 'open-uri'
class IssnLookup
attr_reader :doc
def initialize(issn)
@doc = Nokogiri::XML(open("http://www.sherpa.ac.uk/romeo/api24.php?issn=#{issn}"))
end
def has_data?
@doc.xpath('//numhits').text.to_i == 1 ? true : false rescue false
end
def journal_title
return "" if !has_data?
@doc.xpath('//journals/journal/jtitle').text
end
def publisher
return "" if !has_data?
@doc.xpath('//publishers/publisher/name').text
end
end
Jump to Line
Something went wrong with that request. Please try again.