RAA - ruby-aws/0.4.2

ruby-aws / 0.4.2

Short description: Interface to Amazon Associates Web Service (AWS) v4.
Category: Library/WWW
Status: beta
Created: 2008-03-24 18:55:24 GMT
Last update: 2008-09-10 22:05:56 GMT
Owner: Ian Macdonald (Projects of this owner)
Homepage: http://www.caliban.org/ruby/ruby-aws/
Download: http://www.caliban.org/files/ruby/ruby-aws-0.4.2.tar.gz
License: GPL
Dependency:
None
Description:

Ruby/AWS is the sequel to Ruby/Amazon. See the README file in the archive for more information.

Ruby/AWS is a Ruby language library that allows the programmer to retrieve information from the popular Amazon Web site via Amazon Web Services. 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.

This library is the sequel to Ruby/Amazon. All too often, sequels fall short of expectations, but Ruby/AWS aims to be better than its predecessor. Arguably, that goal has been attained.

AWS v4 API is currently more or less supported in its entirety, with just a few gaps in the implementation of a couple of operations. Currently implemented operations are:

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

Multiple operations and batch requests are also supported, but not well tested. Beware of bugs.

Remote shopping-cart functionality is also implemented. This adds the following operations:

CartCreate
CartAdd
CartModify
CartClear
CartGet


Changes in 0.4.2:

The version of the Amazon AWS API requested when performing operations is now 2008-08-19. This is the latest at the time of writing.

The exception class Amazon::Config::ConfigError was mysteriously not defined.

Amazon::Config.new now accepts an optional argument, config_str, which may contain the string equivalent of a config file's contents. When config_str is not nil (nil is the default), this string is read instead of /etc/amazonrc and ~/.amazonrc. This addition is really just to aid unit-testing of the Amazon::Config class, as Amazon::Config.new never needs to be called by user code.

Config file lines may now contain leading whitespace.

The Amazon::AWS::MAX_PAGES constant has gone, replaced by the PAGINATION hash. Only ItemSearch should use ItemPage to page through results up to MAX_PAGES when ALL_PAGES has been requested, but the same approach was attempted for all types of operation.

Each operation has its own pagination parameter and its own maximum number of pages that can be fetched. This is now stored in the Amazon::AWS::PAGINATION hash.

Note that ItemLookup has three possible pagination parameters: OfferPage, VariationPage and ReviewPage. Ruby/AWS uses OfferPage for the purposes of ALL_PAGES.

Operations that do not explicitly provide a pagination parameter (or, at least, those for which there isn't one listed in the AWS Developer's Guide) use ItemPage and pagination up to page 400. This is likely to throw an exception, as such operations almost certainly don't support multiple results pages.


Changes in 0.4.1:

The exception class Amazon::AWS::HTTPError was not defined.

Extra locations besides $HOME are now scanned for .amazonrc (to assist Windows users). The full order is:

%HOME%
%HOMEDRIVE% + %HOMEPATH%
%USERPROFILE%


Changes in 0.4.0:

A new method, Amazon::AWS::ShoppingCart::Cart#cart_get, has been added, to allow the retrieval of an existing shopping-cart from AWS. This is necessary when the original Cart object no longer exists.

The version of the Amazon AWS API requested when performing operations is now 2008-06-26. This is the latest at the time of writing.

Minor bug fixes.


Changes in 0.3.3:

YAML.aws_load has been removed. Its functionality is available directly from Amazon::AWS::AWSObject.yaml_load and it wasn't logical or necessary to duplicate that in the YAML class itself. There was no corresponding Marshal.aws_load method, but if there had been, that, too, would have been removed.

Ruby/AWS is now finally available as a RubyGems package.The current release can be found here::

http://www.caliban.org/files/ruby/ruby-aws-x.x.x.gem


Changes in 0.3.2:

Serialisation, e.g. with Marshal and YAML, has been a problem until now.

This is because subclasses of Amazon::AWS::AWSObject are created as needed when XML responses from AWS are parsed. Whilst there is no problem dumping objects instantiated from such classes, the difficulty arises when later loading and attempting to reinstantiate them in a new process, because the dynamic classes from which they were spawned no longer exist.

The solution to the problem comes in the form of the new methods Amazon::AWS::AWSObject.load and Amazon::AWS::AWSObject.yaml_load. Use these as
alternatives to Marshal.load and YAML.load, respectively.


Changes in 0.3.1:

This release mostly features refinements to the support for remote shopping-carts.

The 'Save For Later' area of remote shopping-carts is now implemented.

Cart#cart_modify now takes an extra parameter, save_for_later. If true, items are moved from the active to the Save For Later area of the cart. If false, they are moved in the opposite direction.

In both cases, the quantity parameter is ignored, because attempting to pass it through to AWS results in an error, even though the AWS documentation claims this can be done to move partial quantities from one area of the cart to the other.

Cart#include? now also returns true if the item being queried is in the Save For Later area of the cart. Previously, only the active area was inspected.

New methods, Cart#active? and Cart#saved_for_later? (alias Cart#saved?), return whether or not an item is present in a particular area of the cart. If the item is present, its CartItemId is returned; otherwise 'false'.

A bug that caused shopping-cart transactions to use the cache if one was requested has been fixed. Shopping-carts should never use the cache under any circumstances.

Request objects can now have their @cache attribute assigned to. A Cache object may be directly assigned to it, or you may assign the value 'true'. If @cache is set to 'true', a Cache object will automatically be assigned to it the next time @cache is referenced. This is most useful when one wishes to switch from using no cache to using one, or vice versa.

Cache#flush_expired invariably threw an exception. This bug has been fixed.

Geolocation of users by host and IP address now raises an Amazon::Locale::GeoError exception if the host or IP address is unresolvable.

There's a new Ruby/AWS mailing-list for discussion of the development and usage of this library:

http://www.caliban.org/mailman/listinfo/ruby-aws


Changes in 0.3.0:

Remote shopping carts are now implemented. See the Amazon::AWS::ShoppingCart module and the Amazon::AWS::ShoppingCart::Cart class.

Basically, this adds Cart.new, Cart#cart_create, Cart#cart_add, Cart#cart_modify and Cart#cart_clear. There's also Cart#each for iterating over the items in a cart.

The version of the Amazon AWS API requested when performing operations is now 2008-04-07. This is the latest at the time of writing.

A new iterator method, AWSObject#each, yields each |property, value| of the AWSObject.

The AWSObject and AWSArray classes have received a few new helper methods that should make AWSObject and single element AWSArray objects behave more akin to strings when they are being compared with strings, matched against regexes, etc.

When searches are performed, greater efforts are now made to determine whether Amazon returned any errors. In particular, batch operations and MultipleOperations may return errors at different locations in the XML tree than normal operations.

A bug that materialised only when using an HTTP proxy has been fixed.


Changes in 0.2.0:

Many more types of operation are now supported. In fact, everything except shopping cart operations is now supported.

Symbols can now be used instead of Strings as parameters when instantiating operation and response group objects.

Image objects can now retrieve their images and optionally overlay them with percentage discount icons.

Compatibility fixes for Ruby 1.9.

Dozens of other fixes and minor improvements.


Changes in 0.1.0:

This version features a completely rewritten XML parser, which dynamically creates classes based on XML returned by AWS. This makes Ruby/AWS highly future-proof.

Multiple operations are now implemented.

Numerous fixes and small improvements have been made.

Large scale code clean-up has been performed.

Much more documentation has been added.

Versions: [0.8.1 (2010-03-20)] [0.8.0 (2010-02-21)] [0.7.0 (2009-06-16)] [0.6.0 (2009-05-26)] [0.5.1 (2009-05-26)] [0.5.0 (2009-02-20)] [0.4.4 (2008-10-03)] [0.4.3 (2008-09-22)] [0.4.2 (2008-09-10)] [0.4.1 (2008-08-18)] [0.4.0 (2008-07-05)] [0.3.3 (2008-06-23)] [0.3.2 (2008-06-17)] [0.3.1 (2008-06-10)] [0.3.0 (2008-05-19)] [0.2.0 (2008-04-28)] [0.1.0 (2008-04-12)] [0.0.1 (2008-03-24)]

Edit this project (for project owner)

back to RAA top