Skip to content

Commit

Permalink
Add remote cart example
Browse files Browse the repository at this point in the history
  • Loading branch information
hakanensari committed Feb 7, 2012
1 parent c9acde8 commit 107af0a
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions examples/remote_cart.coffee
@@ -0,0 +1,24 @@
util = require 'util'
Hoover = require '../src/hoover'

req = new Hoover
key: process.env.AMAZON_KEY
secret: process.env.AMAZON_SECRET
tag: process.env.AMAZON_TAG

req
.add
operation: 'ItemLookup'
itemId: '0816614024'
responseGroup: 'Offers'
.get (res) ->
id = res.find('OfferListingId')[0]
req
.reset()
.add
operation: 'CartCreate'
'Item.1.OfferListingId': id
'Item.1.Quantity': 1

req.get (res) ->
console.log util.inspect res.find('Cart'), false, null

0 comments on commit 107af0a

Please sign in to comment.