How to run sample code for a gem such as Vacuum?

I am new to rails and want to create a website that uses the Amazon product API. I'm used to using the API in PHP, but try to switch to Ruby, if at all possible.

I am trying to use various Amazon, Ruby / AWS, Amazon-ECS and now Vacuum APIs. However, the problem I am facing is how to actually use the code that they offer in their readme files.

For example, Vacuum:

https://github.com/hakanensari/vacuum/

It mentions the following code:

req = Vacuum.new :product_advertising

req.configure do |config|
  config.key    'key'
  config.secret 'secret'
  config.tag    'tag'
end

req.build operation:    'ItemSearch',
      search_index: 'Books',
      keywords:     'Deleuze'
res = req.get

res.valid? or raise res.code

p res.body

, , . , , Vacuum ( gemfile, ).

, , - , , .

D

Edit:

x1a4, :

req.configure do |config|
  config.key =    'key'
  config.secret = 'secret'
  config.tag =    'tag'
end
+3
1

x1a4, :

req.configure do |config|
  config.key =    'key'
  config.secret = 'secret'
  config.tag =    'tag'
end
0

All Articles