Welcome to Working With Rails


Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Amazon Product API tie in using ruby-aaws gem
1 Post
Amazon Product API tie in using ruby-aaws gem

I am using the ruby-aaws gem to to make calls to the amazon product database. I have got the gem to work great, but i wanted some advice on how to tie the script into my database using the active record. I am not sure where to even start, so if someone could point me in the right direction, that would be great.

the ruby script is below, it will just return the names as a hash of the "chocolates" that i search.

require 'rubygems' require 'amazon/aws/search'

include Amazon::AWS include Amazon::AWS::Search

resp = Amazon::AWS.item_search( 'GourmetFood', { 'Keywords' => 'chocolate' } )

items = resp.item_search_response.items.item

item.each do |item| attribs = item.item_attributes name = attribs.title puts "#{name}" end

I think I need to change the ActiveRecord in the model so it can take the "#{name}" entry, but how do i change the script (or the controller?) in order to send it there.

Any help would be greatly appreciate because I haven't been able to find any suggestions online.


1 Post
Login to add your message