phoet / asin

:books: :package: Amazon Simple INterface - Support for ItemLookup, SimilarityLookup, Search, BrowseNode and Cart Operations
http://asin.herokuapp.com/
167 stars 59 forks source link

Find only books w/images #16

Closed tibbon closed 12 years ago

tibbon commented 12 years ago

Using code like the following, I'm pulling down a list of books.

t = tags.collect {|x| x.name}
client = ASIN::Client.instance
books = (client.search_keywords t)

Works great, except that sometimes it grabs a book like this one: http://www.amazon.com/Lasers-Lynn-Myring/dp/0613769902%3FSubscriptionId%3DAKIAINAJKLF3WOPY77OA%26tag%3Dwha07-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0613769902

which doesn't have an image, so it displays poorly on my page. I could set a 'default' image, but overall, I'd just rather not retrieve ones without an image. Is this possible, or does the Amazon API (or the gem) not allow that?

phoet commented 12 years ago

i don't think it's possible to filter for such a condition, but have a look at the API and find out yourself: http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/ItemSearch.html

all optional parameters can be passed into the search-methods, so you are free to use every API parameter you like!