#!/usr/bin/ruby -w
#
# $Id: rcart,v 1.1 2004/02/29 11:28:23 ianmacd Exp $
#
# This will take one or valid ASINs on amazon.com and spit out a URL that,
# when entered into a browser, will upload a remote shopping cart containing
# the corresponding items to the user's Amazon shopping cart.

require 'amazon/shoppingcart'

if ARGV.empty?
  $stderr.puts "Usage: rcart <asin>+"
  exit 1
end

sc = Amazon::ShoppingCart.new('HSAJSHJASKSASA')

ARGV.each { |asin| sc.add_items(asin, 1) }

puts sc.purchase_url
