Loads From Amazon plugin

Plugin details

ActsAsAmazon allows a developer to declare a mapping between an ActiveRecord model and a product listed on Amazon.

Websitehttp://jystewart.net/process/archives/2006/07/loads_from_amazon-ruby-on-rails-plugin/ Repositoryhttp://projects.jystewart.net/svn/rails/loads_from_amazon/trunk Author James Stewart Tags amazon LicenseUnknown

Documentation

Install the plugin:
ruby script/plugin install http://projects.jystewart.net/svn/rails/loads_from_amazon/trunk

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.to_s) # Loads but does not save
@book = Book.load_from_amazon!(isbn.to_s) # Loads data and saves to database

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago