Plugins - loads_from_amazon

StarAdd to favorites

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

Tags

Comments

Add a comment
James Stewart 15 Oct 2008

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 actsas_amazonproduct -- http://github.com/netphase/aaap/tree/master

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?