No description or website provided.
Pull request Compare This branch is 6 commits behind abandoned:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
spec
.gitignore
.travis.yml
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
amazon_product.gemspec

README.md

Amazon Product

Amazon Product is a Nokogiri-backed Ruby wrapper to the Amazon Product Advertising API.

travis

 Installation

Add to your Gemfile.

gem 'amazon_product'

 Usage

Set up a request.

require "amazon_product"

req = AmazonProduct["us"]

req.configure do |c|
  c.key    = AMAZON_KEY
  c.secret = AMAZON_SECRET
  c.tag    = AMAZON_ASSOCIATE_TAG
end

Search for something.

req << { :operation    => 'ItemSearch',
         :search_index => 'All',
         :keywords     => 'George Orwell' }
res = request.get

Or use a shorthand.

res = req.search('George Orwell')

Customise your request.

res = req.search('Books', :response_group => %w{ItemAttributes Images},
                          :power          => 'George Orwell'

For a reference of available methods and syntax, read here.

Consume the entire response.

res.to_hash

Quickly drop down to a particular node.

res['Item']

Please see the project page for further detail.

Adapters

Amazon Product defaults to the Net::HTTP library but can be configured to use Curb or EM-HTTP-Request.

Branding is a delicate art

Amazon Product descends from Sucker. While I still like the vacuum metaphor, the name felt tiring after a while.