Commit cf184511 by ntphat

Update hash result

parent 64878cdd
...@@ -28,10 +28,10 @@ params = { ...@@ -28,10 +28,10 @@ params = {
#@res = req.item_search(query: params) #@res = req.item_search(query: params)
#@res = req.item_lookup(query: { 'IdType' => 'ASIN', 'ItemId' => '0679753354'}) #@res = req.item_lookup(query: { 'IdType' => 'ASIN', 'ItemId' => '0679753354'})
# ItemAttributes Images AlternateVersions Offers # ItemAttributes Images AlternateVersions Offers
rg = %w(ItemAttributes Images).join(',') rg = %w(ItemAttributes Images EditorialReview).join(',')
@res = req.item_search(query: { @res = req.item_search(query: {
'ItemSearch.Shared.SearchIndex' => 'All', 'ItemSearch.Shared.SearchIndex' => 'All',
'ItemSearch.Shared.Keywords' => 'Rocket&Car', 'ItemSearch.Shared.Keywords' => 'Grow Rich',
'ItemSearch.Shared.ResponseGroup' => rg, 'ItemSearch.Shared.ResponseGroup' => rg,
'ItemSearch.SearchIndex' => 'Toys', 'ItemSearch.SearchIndex' => 'Toys',
'ItemSearch.1.ItemPage' => 1, 'ItemSearch.1.ItemPage' => 1,
...@@ -42,7 +42,7 @@ rg = %w(ItemAttributes Images).join(',') ...@@ -42,7 +42,7 @@ rg = %w(ItemAttributes Images).join(',')
@add_new = [] @add_new = []
@res.to_h["ItemSearchResponse"].to_h["Items"].to_a[0].to_h["Item"].to_a.each do |value| @res.to_h["ItemSearchResponse"].to_h["Items"].to_a[0].to_h["Item"].to_a.each do |value|
book_tmp = value.to_h book_tmp = value.to_h
@add_new.push(image: book_tmp['LargeImage'], item: book_tmp['ItemAttributes']) @add_new.push(details: book_tmp['DetailPageURL'], image: book_tmp['LargeImage'], item: book_tmp['ItemAttributes'], editor: book_tmp['EditorialReviews'])
end end
@ret = [] @ret = []
@result.each {|k, v| @ret.push(k)} @result.each {|k, v| @ret.push(k)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment