Skip to content

Instantly share code, notes, and snippets.

@tonyhb
Last active August 29, 2015 13:57
Show Gist options
  • Save tonyhb/9743747 to your computer and use it in GitHub Desktop.
Save tonyhb/9743747 to your computer and use it in GitHub Desktop.
require 'amazon/ecs'
module Amazon
class Ecs
def self.cart_similarities(asin)
opts = {
service: 'AWSECommerceService',
operation: 'CartCreate',
response_group: 'CartSimilarities'
}
opts["Item.1.ASIN"] = asin
opts["Item.1.Quantity"] = 1
self.send_request(opts)
end
end
end
res = ::Amazon::Ecs.cart_similarities('B00GDBN6KQ')
puts res.marshal_dump
@tonyhb
Copy link
Author

tonyhb commented Mar 24, 2014

Ruby snippet which gets similar products from Amazon using the CartSimilarities response group (instead of ItemSearch's 'Similarities' response group)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment