Skip to content
Ruby Interface for the OpenLibrary API
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
.gitignore
Gemfile
README.rdoc
Rakefile
openlibrary.gemspec

README.rdoc

Openlibrary

OPENLIBRARY is a simple wrapper for the Openlibrary REST-API.

For more information on the REST calls, you can view the api documentation at [here](openlibrary.org/developers/api).

Installation

The gem is tested against Ruby 1.9.2 and runs smoothly with Rails 3.

gem install openlibrary

or in your Gemfile:

gem 'openlibrary'

Usage

You can retrieve a book's Openlibrary listing information.

# just require
require 'openlibrary'

Initiate your search

# create a class proxy 
view = Openlibrary::View

# lookup an item with the ISBN-10 or ISBN-13 
book_view = view.find_by_isbn("0451526538")

or you can use the other built-in finder methods:

find_by_lccn        # Library of congress catalog number
find_by_oclc        # Worldcat Control Number
find_by_olid        # Openlibrary ID

Extract the book information:

# have a look at the book's info URL on Openlibrary.org
book_view.info_url

# or grab the URL of the book's thumbnail as shown on Openlibrary.org
book_view.thumbnail_url

You can also retrieve a book's full metadata details.

# create a class proxy 
details = Openlibrary::Data

# lookup an item with the ISBN-10 or ISBN-13 
book_details = details.find_by_isbn("0451526538")

# have a look at the book's title
book_details.title

# or an array of authors 
book_view.authors

TO DO

Write Tests

Something went wrong with that request. Please try again.