gisbn Ruby GEM

The best way to sell yourself and get exposer as a new developer is contributing to open source projects either writing own libraries as well as tools or contributing to someone else project. I always love to contribute Open Source projects not for selling myself or getting exposer point of view rather I would like to give something back to community. I personally believe that today I came here because of the community supports. As a part of it, I started extracting source code from all of my pet projects and exporting them as a very nice library that other developer can use in their projects. Recently, I published one Ruby Gem: gisbn based on Google Book API.

Basically, it fetches book information from Google Book by API by thirteen or ten digit ISBN number. Lets say, you have the ISBN number and you want to see all the information about that book. This GEM will help you fetch all information about that book.

Couple of years back, when I was in Bangladesh I started a startup is a platform for student, where students can cell, lend and borrow books from another students. One of core features of the application is fetching book information by book’s ISBN number. I had to write a library by myself what fetches information from Google Book API. The whole library I published as a Ruby GEM.

Code examples by the GEM

book = "0262033844", "AIzaSyDKepjfaVBRcgsnPALw5s2UNyfOk-1FHUU", "ca" ##create an account at Google and get API Kyes
#=> "Introduction to Algorithms"
#=> "A new edition of the essential text and professional reference, with substantial new material on such topics as vEB trees, multithreaded algorithms, dynamic programming, and edge-baseflow."
#=> "MIT Press"
#=> <Date: 2001-02-03 ...>
#=> 0262033844
#=> 9780262033848
book.gisbn.isbn = 9780321573513
book.fetch.title  => "Algorithms"

gisbn exposes following methods:

title                >> Returns Book's title as string
description          >> Returns the description of book as string
isbn(isbn_number)    >> Set new isbn
fetch                >> Call to Google Book API and process book information on provided ISBN
authors              >> Return authors' name as comma separated as string
authors_as_array     >> Return authors' name as ruby array. If no book is associated with ISBN number,
                        then it return empty array
publisher            >> Return publisher name as string
isbn_10              >> Return 10 digit ISBN numbers as string
isbn_13              >> Return 13 digit ISBN numbers as string
categories           >> Return category names as comma separated as string
categories_as_array  >> Return category names as ruby array. If no book is associated with ISBN number,
                        then it return empty array
thumbnail_small      >> Return the link of small thumnail
thumbnail            >> Return the link of standard thumnail
preview_link         >> Return the link for previewing the book
page_count           >> Return page count as integer
published_date       >> Return the published date as Ruby object

If you want to contribute and enrich the GEM, you are really welcome, Just visit and fork from my github:

Happy hacking 🙂


Eftakhairul Islam

Hi, I'm Eftakhairul Islam, a passionate Software Engineer, Hacker and Open Source Enthusiast. I enjoy writing about technical things, work in a couple of startup as a technical advisor and in my spare time, I contribute a lot of open source projects.


One thought on “gisbn Ruby GEM

  1. Hi Eftakhairul,
    I know you posted this several years ago but I am trying to do this exact thing in my Ruby app. Once I install the gem how do I reference it in my code? I would like to give my app a page to search for books and then add the book to my database if it is the correct book. I have a modal for manually entering the information which I could have populate with this info if that would be easier.

    I am a little lost with how to move forward with this. I have never done something like this before. Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Read previous post:
Setting up development enviroment with Vagrant

Nowadays we have to work on different different web stacks at the same time. Even in same web stack our...