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.