Skip to content

A wrapper around the item search and lookup functionalities of the ruby-aaws gem

License

Notifications You must be signed in to change notification settings

siannopollo/amazon_products

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amazon Products

Overview

Use this library if you want to pull down information (via searches or specific product lookup) about products on Amazon.

Prerequisites

ruby-aaws gem (sudo gem install ruby-aaws)

You will need an AWS access key ID. The location of this will need to be configured much like what is shown below.

Usage

The yaml file containing your access_key_id should look something like this:

access_key_id: your-key-here

There is no default location for the config file, so you must supply the location somewhere in your app like so:

AmazonProducts.config_location = 'config/amazon.yml'

You can search for products like this:

  require 'amazon_products'
  search = AmazonProducts::Search.new('Books', 'knitting')
  results = search.execute
  @first_result = results.first

Then in an HTML template somewhere, assuming you wanted to use an image from one of your results:

<img src="#{@first_result.medium_image.url}"/>

The individual item lookup works about the same:

require 'amazon_products'
lookup = AmazonProducts::Lookup.new('0834003503', 'ISBN')
@result = lookup.execute

Caveats

Right now there is only support for Books, DVDs, Music and VideoGames (those are all I need right now :-)

About

A wrapper around the item search and lookup functionalities of the ruby-aaws gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages