On Safari – A web app to check SafariBooksOnline.com

Earlier today I launched my very first Sinatra app, OnSafari. OnSafari is a tool to check if a book is available on Safari Books. I’m been a member of Safari Books for several years now and I’m constantly wondering if a book I’m looking at at a bookstore is on Safari or not. OnSafari will let me enter the book’s ISBN number and will search Safari Books’ website for the book.

Technology

My main goal with building OnSafari was to learn a few new technologies that I haven’t had the opportunity to use yet.

  • Sinatra – Sinatra is a micro Ruby framework for building websites. It was very easy to pick up and learn how it works thanks to the documentation in the Sinatra Book. I’m definitely going to be using Sinatra again.

  • HAML – HAML is a templating language that uses white space to generate a HTML document. I didn’t like the idea when I first heard about it but after using it for OnSafari, I’m starting to warm up to it. The templates are a lot easier to read but I did run into some unhelpful parsing errors. I think I’ll give HAML another try on a future side project, but I’m not ready to recommend it for a customer project yet.

  • SASS – SASS is part of the HAML project and does basically the same thing but instead builds CSS files. I started to use SASS for the basic design. Once I integrated the final design though, I ended up dropping SASS in favor of vanilla CSS. Like HAML, I’d like try SASS out on a side project before I recommend it.

  • nokogiri – nokogiri is a HTML and XML parser. Since Safari Books doesn’t have an API, I had to page scrape to “search” for books. I’ve already used Hpricot so I decided to give nokogiri a try. I had no problems with it, even when parsing Safari Books’ JavaScript laden pages.

  • Heroku – Heroku is a hosting environment for Ruby Web application. I decided to try and host OnSafari on Heroku since they have been marketing themselves as the “Instant Ruby Platform”. They really aren’t joking, I was able to setup and deploy OnSafari in 15 minutes. That included making some code changes to accommodate their (lack of a) file system.

Summary

Overall, I’m very happy with the results of OnSafari. I learned a lot and was able to successfully build a site I’ve been wanting for awhile. I think my biggest surprise was how easy it is to host on Heroku. I’m now considering moving several other applications to their service, so I don’t have to administer their servers anymore.

If you have a Safari Books account, I’d appreciate it if you would give OnSafari a try.

Eric