UPDATE (10/2008): This plugin is no longer maintained. I’d recommend looking at one of the newer alternatives such as acts_as_amazon_product if you need this functionality.
I’ve been procrastinating on getting my first Ruby on Rails plugin (first anyone else might be interested in, at least) out the door, mainly due to some configuration problems with Subversion, but finally I have that all sorted out and the plugin ready to go.
loads_from_amazon 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 '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
So feel free to grab it from svn ( http://projects.jystewart.net/svn/rails/loads_from_amazon/trunk) and let me know what you think.