Acts As Amazon Product

Acts As Amazon Product, or AAAP for short, is a Ruby Gem developed by Netphase and available on github as an Open Source offering. This gem allows you to easily include products from Amazon’s vast catalog in your application. You have great control over whether you want the items to load into their own models, or one of your own, and also if the model is saved or merely loaded in memory for further action by you application.

We have used Acts As Amazon Product in production, as have other stellar Ruby on Rails consultancies. We hope that you find it as helpful as we have. And true to the open source nature of the project, if you have any ideas on how we can make AAAP better, by all means, submit a pull request!

For more information on AAAP, check out the project page on Github. Enjoy!

2 Comments to “Acts As Amazon Product”

  1. Jose 7 August 2009 at 4:48 am #

    Hi,

    I’ve been trying to set this up to work with a Video search index and UPC lookup instead of ASIN.

    I got it working once (have no idea how) but it broke and haven’t been able to get it running correctly again.

    Here are my model arguments:

    acts_as_amazon_product :access_key => ‘XXXXXXXXXX’, :associate_tag => ‘XXXXXXXXXX’ ,:search_index => ‘Video’, :auto_load_fields => {:title => ‘title’, :upc => ‘upc’,
    :category => ‘binding’, :asin => ‘asin’,
    :description => ‘content’, :poster => ’smallimage/url’, :poster_url => ‘mediumimage/url’,
    }

    and my view:

    <tr class=”">

    <img src= “”>

    [..........]

    Error: NoMethodError in Peliculas#index

    Showing app/views/peliculas/index.html.erb where line #16 raised:
    You have a nil object when you didn’t expect it!
    You might have expected an instance of ActiveRecord::Base.
    The error occurred while evaluating nil.valid?

    16:

    Console:
    No known attributes to search by

    Help will be greatly appreciated!!

  2. Marc 6 November 2009 at 9:41 pm #

    As of August 15th, Amazon requires a signature for a item_lookup request. I dug through the code and it seems I can add my secret_key so Amazon::Ecs can generate a signature. However, it seems Amazon::Ecs.options.secret_key never gets set. I’m not sure if this is a problem with Amazon:Ecs or with AAAP but I couldn’t find anything about it on the web so I’m thinking it’s AAAP-related. – Any ideas?

    @Jose
    I’ve had a problem with AAAP before and turned out I was using integers instead of strings for my ISBN numbers. I can’t say if that would be your problem without seeing the rest of the code, but I thought I’d share it anyway.


Leave a Reply