Last active
August 28, 2018 02:22
-
-
Save pooza/b97990f927121caf0d3e128abb944e86 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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