Module: XISBN
- Defined in:
- lib/xisbn.rb
Overview
Pass in an ISBN and get back a list of related isbns as defined by the OCLC xisbn webservice at www.oclc.org/research/projects/xisbn/
require 'xisbn'
include XISBN
isbns = xisbn('0-9745140-8-X')
If you want to guard against timeouts pass in the number of seconds you don’t want to wait longer than:
isbns = xisbn('0-94745140-8-X', :timeout => 1)
If you want to use LibraryThing’s xisbn service:
isbns = thing_isbn('0-9745140-8-X')
Constant Summary collapse
- @@oclc_uri =
URI.parse('http://old-xisbn.oclc.org/webservices/xisbn')
- @@thing_uri =
URI.parse('http://www.librarything.com/api/thingISBN')
Instance Method Summary collapse
Instance Method Details
#thing_isbn(isbn, opts = {}) ⇒ Object
30 31 32 |
# File 'lib/xisbn.rb', line 30 def thing_isbn(isbn, opts={}) return get_isbns(@@thing_uri, isbn, opts) end |
#xisbn(isbn, opts = {}) ⇒ Object
26 27 28 |
# File 'lib/xisbn.rb', line 26 def xisbn(isbn, opts={}) return get_isbns(@@oclc_uri, isbn, opts) end |