Skip to content

zacharyw/ruby-aaws

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby/AWS - A Ruby interface to the Amazon Associates Web Services API.

Introduction

Ruby/AWS is a Ruby language library that allows programmatic access to the popular Amazon Web sites via the AWS v4 API. It is the successor to the now obsolete Ruby/Amazon.

In addition to the original amazon.com site, the local sites amazon.co.uk, amazon.de, amazon.fr, amazon.ca and amazon.co.jp are also supported.

Although the library is still in development, the AWS v4 API is now more or less fully supported, with only tiny gaps in the functionality of some operations.

The following operations are supported:

BrowseNodeLookup
CustomerContentLookup
CustomerContentSearch
Help
ItemLookup
ItemSearch
ListLookup
ListSearch
SellerListingLookup
SellerListingSearch
SellerLookup
SimilarityLookup
TagLookup
TransactionLookup
VehiclePartLookup
VehiclePartSearch
VehicleSearch

Remote shopping-carts are also supported. This adds the following operations:

CartCreate
CartAdd
CartModify
CartClear
CartGet

Finally, multiple operations and batch requests are also supported.

Ruby/AWS supports request authentication, using your secret key to sign your requests to AWS.

Beyond wrapping features readily available in the AWS API, Ruby/AWS also offers advanced features not directly supported by the AWS API, such as the ability to retrieve all results pages for a particular search, rather than having to manually deal with multiple AWS responses of 10 results per page.

You can also retrieve product images and optionally overlay them with percentage discount icons.

Another advanced feature is the ability to cache responses returned by AWS. If the cache is used (as it is by default), the results of each unique search will be cached and used for 24 hours. The cache can be manually flushed of all or just the expired entries.

One other useful advanced feature is the ability to determine the appropriate Amazon locale for a given client, based on its IP address or host name. This allows you to perform AWS operations using the correct geographical Amazon site for any given client. German and Austrian clients can be made to interact with amazon.de, British and Irish clients with amazon.co.uk, etc.

Installation

Use ‘gem install zacharyw-ruby-aaws’. Alternatively, if you’re using Bundler, add *gem ‘zacharyw-ruby-aaws’* to your Gemfile.

In order for ruby-aaws to interact with Amazon, you need to provide it with your API information and associate id. You can pass these directly into the Request.new constructor, but that is not recommended. You should instead create a file called .amazonrc, which looks like this:

key_id = 'your_public_key'
secret_key_id = 'your_private_key'
associate = 'your_associate_id'
cache = false
locale = 'us'
encoding = 'iso-8859-15'

Put this file in your user directory. On Linux/Unix it will be wherever cd ~ takes you (be sure to do it as the user you’re running your rails app as). On Windows, put it in C:UsersUsername.

Lastly, just play around with using ruby-aaws and the Amazon API. The Amazon API is very spaghetti-like, you’ll probably have to experiment to see how the returned Amazon xml gets mapped into ruby-aaws objects.

The examples in this project are good, but you’ll likely need to fiddle with them.

Prerequisites

Before you can use this library, you need to obtain an Amazon Web Services access key ID.

You should also apply for an Associates account, although this isn’t strictly necessary. If you do not explicitly provide an Associates tag in the operations you conduct via Ruby/AWS, the tag of the Ruby/AWS author will be used by default.

See Also

Ultimately, the way to get the most from Ruby/AWS is to read the AWS documentation to get a feel for what is possible, and then experiment with the library to see how the calls to AWS are mapped to the Ruby world. You should also review this library’s RDoc documentation as well as the plain-text README file that came with the archive.

Additionally, there’s a mailing-list available, where you can discuss any Ruby/AWS-related subjects and issues.

Please see the AWS Developer Resources home page, the Amazon Web Services API documentation, and, in particular, the release notes for definitive information on the capabilities and inner workings of the AWS API.

Download

Version 0.8.1


Author

Ian Macdonald <ian@caliban.org>

Version

0.8.1

Copyright

© 2008-2010 Ian Macdonald

Licence

GPL

About

A fork of the ruby-aaws library. Works with Rails 3.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%