Skip to content

Instantly share code, notes, and snippets.

@pooza
Last active August 28, 2018 02:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/b97990f927121caf0d3e128abb944e86 to your computer and use it in GitHub Desktop.
Save pooza/b97990f927121caf0d3e128abb944e86 to your computer and use it in GitHub Desktop.
require 'amazon/ecs'
Amazon::Ecs.configure do |options|
options[:AWS_access_key_id] = AMAZON_ACCESS_KEY
options[:AWS_secret_key] = AMAZON_SECRET_KEY
options[:associate_tag] = AMAZON_ASSOCIATE_TAG
end
begin
response = Amazon::Ecs.item_lookup(asin, {country: 'jp', response_group: 'Images'})
raise response.error if response.has_error?
image_url = response.items.first.get('LargeImage/URL')
rescue Amazon::RequestError => e
sleep(1)
retry
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment