无法从Amazon production API获取Item详细信息

时间:2016-07-28 09:13:26

标签: ruby-on-rails amazon-product-api

我正在使用the gem来获取商品详情。我能够获得除项目描述之外的所有内容,请建议我如何获得项目描述。请参阅我想要的screenshot。我选择了说明。

查找我的配置

Gemfile

 gem 'amazon_product', '~> 3.0', '>= 3.0.1'

服务/ amazon_service.rb

class AmazonService
    def initialize(params)
        @ItemPage = params[:ItemPage]
        @keyword = params[:keyword]
        @book_id = params[:book_id]
        $req = AmazonProduct['us']
        $req.configure do |c|
        c.key    = ENV['AWS_access_key_id']
        c.secret = ENV['AWS_secret_key']
        c.tag    = ENV['associate_tag']
    end
    end
    def itemlookup`enter code here`
        $req << {
        :operation    => 'ItemLookup',
        :search_index => 'Books',
        :Keywords => 'Book',
        :IdType => 'ISBN',
        :ItemId => @book_id,
        :response_group => ['ItemAttributes','Images'], 
    }
    $req.get
    end
end

控制器

 @resp = AmazonService.new({book_id: 1338099132}).itemlookup

1 个答案:

答案 0 :(得分:0)

产品说明存储在“编辑评论”节点下。

library(ggplot2)

# Fake data
set.seed(115)
dat = data.frame(auto=rnorm(18,200,50), year=rep(c(1993,seq(1995,2010,5),2014), each=3),
                 group=rep(c("A","B","C"),6))

pd = position_dodge(0.8)

ggplot(dat, aes(year, auto, color=group)) +
  geom_line(position=pd) +
  geom_point(position=pd) +
  scale_y_continuous(limits=c(0,max(dat$auto))) +
  scale_x_continuous(minor_breaks=1993:2016) +
  theme_bw()

要让它需要找到带有“产品描述”值的源节点

EditorialReviews:
    EditorialReview:
      Source: Product Description
      Content: '<ul><li> Front Opening, Long Sleeve, Pure Color, Patternless,
        Draped, Scarf Hem, Stretch, Loose Style, Textured, Ruffled, </li><li>
        The model is about 5.2Ft in height.</li></ul><table border="1" cellpadding="1"
        cellspacing="1" width="200"><tr><td>Asian Size</td><td>International Size</td><td>US
        Size</td><td>Bust Girth</td><td>Waist Girth</td><td>Hip Girth</td><td>Arm