curl-users
Newbie: Automated Purchasing
Date: Sun, 26 Sep 2004 12:54:49 -0700
Hello,
I a bit new to this so hopefully someone can straighten me out.
My Goal: To automate the purchase of a handful of books/CDs at
www.half.com without requiring human intervention.
My Progress: When I found cURL I was really excited since this seemed
like a great way to accomplish my goal using a shell script. However
I'm having some difficulties adding things to the half.com shopping
cart.
This first command works okay to load the product info page and setup
some cookies:
/usr/bin/curl -A "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O;
rv:1.7.3) Gecko/20040913 Firefox/0.10" -L -e ";auto" -c cookies.txt -b
cookies.txt "http://half.ebay.com/cat/buy/inv.cgi?offer_id=1157864846"
This next command loads a URL from the previously loaded page. It is
supposed to add the item to the shopping cart, but the page it returns
says "You have no items in your cart."
/usr/bin/curl -A "Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O;
rv:1.7.3) Gecko/20040913 Firefox/0.10" -L -e ";auto" -b cookies.txt -c
cookies.txt
"http://half.ebay.com/account/cart/cart.jsp?
action=add&item=1157864846&shipmethodid=2"
At first I thought that client side cookie manipulation through
javascript might be causing the problem; but these links work fine in
Safari or Firefox when javascript is turned off.
So, am I doing anything obviously wrong? Or is this task merely not
achievable using cURL? If is not can anyone point me to another
utility that might help me out?
Thanks so much for any input you can provide.
--Joshua Horan
Received on 2004-09-26