I’m a fan of APIs, Web Services, and Mashups, and it’s no secret. One of my New Year’s resolutions is to create and publish more mashups, instead of simply lengthening my ever-growing ideas.txt file. A couple of weeks ago I relaunched, with little fanfare, DRM News, a domain I’ve owned for several years now. It’s simply an RSS aggregator from several sources revolving around digital rights management. It was trivial to slap together, to the point where I’d hardly consider it programming. But hey, at least I deployed something.
When I saw the Reddit post about the New York Times Best Seller API, I thought it would be a good opportunity to do a mashup for popular books. My hope was to create a site that could be on “auto-pilot” and maybe even send me a Amazon Associate check every now and then. I designed the site to use extensive caching of the NYT and Amazon APIs to minimize remote calls, but update the data often enough so that the information would be fresh. A few nights of hacking later and we have:
Reading Radar – From the New York Times Bestseller Lists
The NYT API was simple enough to use. The REST API offers three response formats, XML, JSON, or serialized PHP. I did find a bug in the API, and was very pleased how reactive the NYT API team was to resolve the problem. Kudos!
The guts of the mashup are simple. I’m using YUI for the layout and initial CSS, and JQuery for some visual effects on the list pages. On the server side, I’m using my current favorite thing ever, the Maintainable Framework. I was made aware of the framework by Mike Naberezny, one of the two main authors. Mike and I are ex-Zenders, and Mike was responsible for much of the code early on with the Zend Framework. The Maintainable Framework is very Rails-like, and because I’m familiar with some of the conventions in Rails, getting going with Maintainable was a cinch. Mike’s documentation is well-done, and I’m looking forward to using this framework for all things PHP for the foreseeable future, and hope to help out with bugs and maybe even some code.
Reading Radar is simple enough that I decided to forgo a database and just use a file based cache, powered by the Zend_Cache component of the Zend Framework. I’m using two caches, one that does not expire, and one that expired every several hours so that my data is fresh. I’m caching just a few API calls: the list of lists from the NYT API, which powers the left navigation; the actual lists themselves, which also provide book data; and the individual book histories. The NYT API offers a few other bits of information I’m not using, such as links to the first chapters and editorial reviews. The reason I don’t is because when I spot-checked several books, most of them did not have these links. My hope is that as the API matures, more of the data will find its way in.
To pull the Amazon information, I turn to the easy to use Zend_Service_Amazon component from Zend Framework. It provides me the ratings data, reviews, related products, images, number of pages, and so forth. So using the ISBN numbers from the NYT API, I’m able to query for the Amazon products, and spew those gratuitous affiliate links everywhere using the Amazon ASIN IDs.
So the end result, ideally, is that I have an automatically up-to-date site that I’ll never have to touch, is relevant to the search engines, and will generate passive income. Realistically, it was a fun way to spend a few evenings doing what I love: making mashups. The site is far from perfect, and I’m sure there will be bugs to squash.
I’m love to hear opinions and ways to make this little site better. I know my designer buddies could offer suggestions, and I’d be interested to hear from the affiliate marketing gurus about better ways to integrate the Amazon links better than I have. My real question is, how would you drive traffic to something like this, and would it even be worthwhile?
Jimmy Palmer and I have been thinking of some interesting ideas to extend sites like Reading Radar.. more on that as it develops.
February 4th, 2009 at 9:56 am
[…] Reading Radar, c’est l’occasion de comprendre par l’exemple ce que sont une API et un Mashup. Pour les API, j’avais posé la question à Christian Fauré. Là, non seulement nous avons l’exemple du site, mais son auteur nous détaille la recette sur son blog. […]
February 5th, 2009 at 2:45 pm
Great job John. I love the possibilities of ReadingRadar.com.
February 5th, 2009 at 3:43 pm
Nice work, John.
I know absolutely ziltch about programming … I know a little more about publishing and I certainly qualify as a voracious reader and NY Times/Amazon bestseller list obsessive!
I think ReadingRadar is a great idea, although I think this idea could be taken a few steps further to solve a very big problem in the publishing industry… but that’s another story.
Still, nice site – fast and simple layout. Great for people like me.
Cheers
February 5th, 2009 at 5:32 pm
This is a great idea – very nice work. I’m going to go there and then never leave ever.
February 6th, 2009 at 3:01 am
[…] Amazon’s web services to serve up a fast and straightforward list of popular books. John has written an introductory post on his blog: I’m a fan of APIs, Web Services, and Mashups, and it’s no secret. One of my New […]
February 10th, 2009 at 3:51 am
[…] Amazon’s web services to serve up a fast and straightforward list of popular books. John has written an introductory post on his blog: I’m a fan of APIs, Web Services, and Mashups, and it’s no secret. One of my New […]
February 15th, 2009 at 7:49 pm
Nicely done!
But are you sure your affiliate links don’t violate the NY Times API terms forbidding commercial use?
February 15th, 2009 at 8:08 pm
@Michael,
I contacted the API team as soon as I made the site live. This is something I always try to do with API providers. The simple response I got back was “good stuff”. You’re welcome to interpret that as you like.
February 15th, 2009 at 8:59 pm
Thanks for the information. I have a blog that I’d like to use the API with, but it has a little bit of advertising on it to help pay for bills. I’ll get in touch with the team and see what they say. Sounds like they may be reasonable about the commercial restrictions.
February 16th, 2009 at 3:05 am
Congrats John, this is one awesome mashup. Extremely useful and a targeted niche. I hope you’re making some affiliate commission off of the amazon books… great for a little residual income off your work.
Well done man.
February 16th, 2009 at 7:45 pm
I have added book reviews links. I to enter them by hand from over 20 sites. You can find it at the NYT bestseller list ( http://www.bookwormhole.net/?document=nyt_bs.html )
I have over 8500 reviews, you can find them by searching for a book on the home page
February 19th, 2009 at 12:17 pm
You could add a view of the Random House books’ internal book pages using the “Insight” API. http://www.randomhouse.biz/webservices/insight/
October 13th, 2009 at 9:46 pm
[…] detailed how he did it in this great blog post, and it set my mind to racing with possibilities for libraries. For one, I didn’t know that […]