Use this library if you want to pull down information (via searches or specific product lookup) about products on Amazon.
ruby-aaws gem (sudo gem install ruby-aaws)
You will need an AWS access key ID. The location of this will need to be configured much like what is shown below.
The yaml file containing your access_key_id should look something like this:
There is no default location for the config file, so you must supply the location somewhere in your app like so:
AmazonProducts.config_location = 'config/amazon.yml'
You can search for products like this:
require 'amazon_products' search = AmazonProducts::Search.new('Books', 'knitting') results = search.execute @first_result = results.first
Then in an HTML template somewhere, assuming you wanted to use an image from one of your results:
The individual item lookup works about the same:
require 'amazon_products' lookup = AmazonProducts::Lookup.new('0834003503', 'ISBN') @result = lookup.execute
Right now there is only support for Books, DVDs, Music and VideoGames (those are all I need right now :-)