diff options
| author | mo khan <mo@mokhan.ca> | 2014-10-13 12:53:01 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2014-10-13 12:53:01 -0600 |
| commit | 2575f945ef2f24bb2e6f0bcd3cc54458f45712dc (patch) | |
| tree | d5c3d128c77b89c730a5bc6151758e320188205d | |
| parent | 06a03905f9171e6d61cb2937acb9d48cc166e439 (diff) | |
add lookup for individual amazon product.
| -rw-r--r-- | app/services/infrastructure/amazon_api.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/services/infrastructure/amazon_api.rb b/app/services/infrastructure/amazon_api.rb index 611e86bc..20afb02e 100644 --- a/app/services/infrastructure/amazon_api.rb +++ b/app/services/infrastructure/amazon_api.rb @@ -5,6 +5,10 @@ class AmazonAPI @client = client end + def find(asin) + client.lookup(asin).first + end + def search(query) return [] if query.blank? results = client.search(Keywords: query, SearchIndex: :Kitchen, Sort: :salesrank, Availability: :Available, MerchantId: :Amazon) |
