Sucker

Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

Sucker is a paper-thin Ruby wrapper to the Amazon Product Advertising API. It runs on cURL and Nokogiri and supports the entire API.

Details

Submitted By: delescluze
AWS Products Used: Amazon Associates Web Service
Language(s): Ruby
License: MIT License
Source Control Access: http://github.com/papercavalier/sucker
Created On: August 10, 2010 9:35 AM GMT
Last Updated: August 16, 2010 5:11 PM GMT
Download

Sucker is a paper-thin Ruby wrapper to the Amazon Product Advertising API. It runs on cURL and Nokogiri and supports the entire API.

Set up a worker.

worker = Sucker.new(
  :locale         => "us",
  :key            => "API KEY",
  :secret         => "API SECRET")

Fiddle with curl.

worker.curl { |c| c.interface = "eth1" }

Set up a request.

worker << {
  "Operation"     => "ItemLookup",
  "IdType"        => "ASIN",
  "ItemId"        => asin_batch,
  "ResponseGroup" => ["ItemAttributes", "OfferFull"] }

Hit Amazon.

response = worker.get

View the internals of the response object.

p response.code,
  response.time,
  response.body,
  response.xml

Work on the entire document or a particular node.

pp response.to_hash,
   response.node("Item"),
   response.node("Error")

Hit Amazon again.

worker << { "ItemId"  => another_asin_batch }
pp worker.get.node("Item")

Check the integration specs for more examples.

Comments

awesome
this is really easy to use, thank you a lot.
timlawrenz on October 12, 2010 2:02 PM GMT
We are temporarily not accepting new comments.
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.