对亚马逊产品搜索结果进行分页
我正在使用 gem amazon_product 在亚马逊中搜索图书。 搜索非常顺利,但它只给我提供了前 10 本书的列表。 我想获取所有搜索结果并对它们进行分页。我该怎么做?
我的代码看起来像这样,
req = AmazonProduct["us"]
req.configure do |c|
c.key = "KEY"
c.secret = "SECRET_KEY"
c.tag = "TAG"
end
resp = req.search("Books", :power => params[:book][:search_term], :sort => "reviewrank")
@books = resp.to_hash["Items"]["Item"]
I am using the gem amazon_product for searching the books in Amazon.
The search is perfectly fine but it gets me only a list of first 10 books.
I want to get all the search results and paginate them. How can I do this?
My code looks like this,
req = AmazonProduct["us"]
req.configure do |c|
c.key = "KEY"
c.secret = "SECRET_KEY"
c.tag = "TAG"
end
resp = req.search("Books", :power => params[:book][:search_term], :sort => "reviewrank")
@books = resp.to_hash["Items"]["Item"]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从他们的 API 页面 - http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl
他们有“RelatedItemPage”和“ItemPage”
您应该尝试一下
希望这会有所帮助。
From their API page at - http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl
They have "RelatedItemPage" and "ItemPage"
You should give this a try
Hope this helps.