Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby Interface for the OpenLibrary API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 Gemfile
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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.