Thursday, 16 June 2011

Kindlifying your Amazon wishlist with Ruby

I have a serious addiction buying books, so I try to manage it by putting books I like on my Amazon wishlist. One of the problems of having a lot of books is the space they take up, so ideally I would like to replace as many of my books as possible with ebooks using a device like the Kindle. Unfortunately, when you have bought a Kindle, there is no option on Amazon Wishlist to find out which books on your wishlist exist on the Kindle.

So I wrote some Ruby code to do it. At the moment, it will only work for Amazon UK and US users, but it should be possible to change it to other countries with out too much difficulty. To use it, you will need to install Ruby, then install Ian McDonald's Amazon Web Services Library and get an Amazon Web services key. You will also need to install Nokogiri. Then call this Ruby script with the email address associated with the Wishlist and the locale - 'us' for Amazon.com and 'uk' for Amazon.co.uk:

./Kindlify.rb joe@example.com us

Of course, this is all probably beyond the average user. So I am working on a website to do it, but first I need to learn a bit of Rails.