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

Response not contain image product #28

Closed dieuit07 closed 11 years ago

dieuit07 commented 11 years ago
require 'asin'
    ASIN::Configuration.configure do |config|
      config.secret        = 'SG7Z6LG8SxLk4vTC*********+s/hqOThFhOb'
      config.key           = 'AKIAI********RMMKU5NGQ'
      config.associate_tag = 'books'
    end
    client = ASIN::Client.instance
    book = client.search(:Keywords => 'William W. Purkey', :SearchIndex => :Books).first

result call back is book "From Conflict to Conciliation: How to Defuse Difficult Situations by William W. Purkey, John J. Schmidt and John M. Novak". I can get title, details_url, but image_url is nil. IN result I see "LargeImage=#Hashie::Mash>>", BUT in website search I see it have image

http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Dstripbooks&field-keywords=William%20W.%20Purkey
phoet commented 11 years ago

there is nothing that i can do about it. it's just missing from the amazon data.

you can debug this on your own. this is the response that comes from the amazon webservice. i extracted the relevant item for you:

D, [2013-09-05T09:10:19.979464 #21408] DEBUG -- : HTTPI GET request to webservices.amazon.com (httpclient)
D, [2013-09-05T09:10:20.361246 #21408] DEBUG -- : got response='<?xml version="1.0" ?>
[...]
<Item><ASIN>1412979862</ASIN><DetailPageURL>http://www.amazon.com/From-Conflict-Conciliation-Difficult-Situations/dp/1412979862%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1412979862</DetailPageURL><ItemLinks><ItemLink><Description>Technical Details</Description><URL>http://www.amazon.com/From-Conflict-Conciliation-Difficult-Situations/dp/tech-data/1412979862%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>Add To Baby Registry</Description><URL>http://www.amazon.com/gp/registry/baby/add-item.html%3Fasin.0%3D1412979862%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>Add To Wedding Registry</Description><URL>http://www.amazon.com/gp/registry/wedding/add-item.html%3Fasin.0%3D1412979862%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>Add To Wishlist</Description><URL>http://www.amazon.com/gp/registry/wishlist/add-item.html%3Fasin.0%3D1412979862%26SubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>Tell A Friend</Description><URL>http://www.amazon.com/gp/pdp/taf/1412979862%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>All Customer Reviews</Description><URL>http://www.amazon.com/review/product/1412979862%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink><ItemLink><Description>All Offers</Description><URL>http://www.amazon.com/gp/offer-listing/1412979862%3FSubscriptionId%3DAKIAIBNLWSCV5OXMPD6A%26tag%3Dphoet-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D386001%26creativeASIN%3D1412979862</URL></ItemLink></ItemLinks><ItemAttributes><Creator Role="Editor">William W. Purkey</Creator><Creator Role="Editor">John J. Schmidt</Creator><Creator Role="Editor">John M. Novak</Creator><Manufacturer>Corwin</Manufacturer><ProductGroup>Book</ProductGroup><Title>From Conflict to Conciliation: How to Defuse Difficult Situations</Title></ItemAttributes></Item>
[...]
</ItemSearchResponse>'
dieuit07 commented 11 years ago

Thanks for reply. I add :ResponseGroup => :Medium. and Result now have image. I think amazon API have some new change.

AND onething: I can't get price some url.EX: http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=Marilyn+Monroe&rh=n%3A283155%2Ck%3AMarilyn+Monroe.

Marilyn Monroe: Beyond the Legend (Hollywood Collection) by Gene Feldman and Suzette Winter (Jun 12, 2013)

phoet commented 11 years ago

@dieuit07 oh yeah, you are totally right! i have not used this gem for a year now and forgot about the response groups :smile_cat:

if there is a problem with the urls or any data contained in the xml response, there is no chance i can help. please contact the amazon support for that.

the response should be logged to STDOUT unless you configured it otherwise.