Skip to content

ewlarson/openlibrary

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Ruby Interface for the OpenLibrary API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%