Links
loads_from_amazon
Categories
loads_from_amazon
loadsfromamazon is an ActiveRecord Mixin that works with the Ruby/Amazon library to let you populate an ActiveRecord object with the details of a product listed on amazon. In the README I use the following example:
class Book < ActiveRecord::Base
acts_as_amazon
maps_to_amazon_attribute :authorlist => 'authors', :combine => ';'
maps_to_amazon_attribute :title => 'product_name'
maps_to_amazon_attribute :isbn => 'asin'
maps_to_amazon_attribute :publisher => 'manufacturer'
maps_to_amazon_attribute :pubdate => 'release_date'
end
@book = Book.load_from_amazon(isbn) # Loads but does not save
@otherbook = Book.load_from_amazon!(other_isbn) # Loads data and saves to database
Vitals
| Home | http://jystewart.net/process/archives/2006/07/loads_from_amazon-ruby-on-rails-plugin/ |
|---|---|
| Repository | http://projects.jystewart.net/svn/rails/loads_from_amazon/ |
| License | BSD |
| Tags |
activerecord
|
| Rating | (1 vote) |
| Owner | James Stewart |
| Created | 20 July 2006 |
Comments
-
This one stopped being maintained quite a while ago. I meant to rewrite it to sit on a more up to date Amazon ECS library, but never got round to it.
These days it'd be better to look at something like acts_as_amazon_product -- http://github.com/netphase/aaap/tree/master

