README.md in sucker-0.7.0 vs README.md in sucker-0.7.1
- old
+ new
@@ -9,13 +9,14 @@
--------
Set up a worker.
worker = Sucker.new(
- :locale => "us",
- :key => "API KEY",
- :secret => "API SECRET")
+ :locale => "us",
+ :key => "API KEY",
+ :secret => "API SECRET",
+ :associate_tag => "ASSOCIATE TAG")
Fiddle with curl.
worker.curl { |c| c.interface = "eth1" }
@@ -25,21 +26,26 @@
"Operation" => "ItemLookup",
"IdType" => "ASIN",
"ItemId" => asin_batch,
"ResponseGroup" => ["ItemAttributes", "OfferFull"] }
-Hit Amazon and do something with the response.
+Hit Amazon.
response = worker.get
- # Response internals
+View the internals of the response object.
+
p response.code,
response.time,
response.body,
response.xml
- response.to_h("Item").each { |book| do_something }
- response.to_h("Error").each { |error| p error["Message"] }
+Work on the entire document or a particular node.
+
+ pp response.to_hash
+
+ response.node("Item").each { |book| do_something }
+ response.node("Error").each { |error| do_something }
Hit Amazon again.
worker << { "ItemId" => another_asin_batch }
response = worker.get