Tucano

Build Status

When taking part in a hackathon recently I was looking for a simple gem to pull products from Amazon based on a search string. I found a few but none did exactly what I wanted, so I built this one. Tucano simply gives you an array of items with basic attributes.

Installation

gem install tucano

Usage

Before you start you will need an Amazon Product Advertising key, which you can aquire by signing up here. You will also need and Affiliate Tag. Get one here.

Once all thats set up you can create a new Tucano Search object using your details:

tucano = Tucano::ProductSearch.new('api-key', 'secret, affiliate-tag')

Now it's as simple as searching:

products = tucano.search("Ruby Book")

This returns an Array of Tucano::Items with names, prices, currency, category and a large image.

product = products.first

=> Tucano::Item:0x007fb5e40edde0 @name="Ruby on Rails 3 Tutorial: Learn Rails by Example (Addison-Wesley Professional Ruby Series)", @category="Book", @price="3999", @currency="USD", @image="http://ecx.images-amazon.com/images/I/51TEzGZ%2BggL.jpg, @url="http://www.amazon.com/Ruby-Rails-Tutorial-Addison-Wesley-Professional/dp/0321743121%3FSubscriptionId%3DAKIAJ5HO5KJC4OISP7WQ%26tag%3Dvoicsear-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0321743121""

So you can do stuff like:

product.name => "Ruby on Rails 3 Tutorial: Learn Rails by Example (Addison-Wesley Professional Ruby Series)"

Price #{product.price/100} #{product.currency} => 39.99USD

The gem is still slightly unstable but I hope that I (or indeed you guys) can sort it out over the next few days.

Contributing to Tucano

  • Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
  • Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
  • Fork the project.
  • Start a feature/bugfix branch.
  • Commit and push until you are happy with your contribution.
  • Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright (c) 2012 Mark Provan. See LICENSE.txt for further details.