cURL / Mailing Lists / curl-users / Single Mail

curl-users

Problems with curl run in batch script on WinXP

From: <Junkmail_at_srjava.cjb.net>
Date: Mon, 24 Jul 2006 14:32:59 -0500

I'm trying to login to ebay and retrieve the "My Ebay" page. I used
the PHP script posted in the scripts section and converted it to the
correct command line calls instead of using the PHP function. It takes
3 calls and gets the cookies right and returns the "My Ebay" page
perfectly when I enter the commands on the command line. When I put all
3 curl calls in a small DOS batch file, it won't work. It doesn't seem
to be passing the cookies correctly as it's not logging into ebay
correctly even though I use the EXACT same commands as I run
interactively (copy & pasted them). The HTTP gets seem to work, but
cookies (or something session related) don't seem to transfer right or
something because the 3rd call (which should show "My Ebay") only shows
a login page asking for credentials. Of course I need it to run from a
DOS script because the calls will eventually be made from a Coldfusion
application. Can someone suggest what the problem is?

Here's what I run (You have to sub your username/pass for EBAY_ID &
EBAY_PASS of course )
-----------------
curl -o C:\temp\ebay\curlsignin1.htm -L -b C:\temp\ebay\curlcookies.txt
-c C:\temp\ebay\curlcookies.txt -e
https://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn -A "Mozilla/5.0
(Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)" "https://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn"

curl -o C:\temp\ebay\curlsignin2.htm -L -b C:\temp\ebay\curlcookies.txt
-c C:\temp\ebay\curlcookies.txt -e
https://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn -A "Mozilla/5.0
(Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)" -d "userid=EBAY_ID&pass=EBAY_PASS"
"https://signin.ebay.com/aw-cgi/eBayISAPI.dll?MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=http%3A%2F%2Fcgi3.ebay.com%2Faw-cgi%2FeBayISAPI.dll%3FAdultLoginShow%26amp%3Bt%3D1%26amp%3Bpass%3D%7B_pass_%7D%26amp%3Buserid%3D&pp=pass&pa1=&pa2=&pa3=&i1=0&pageType=94"

curl -o C:\temp\ebay\curlsignin3.htm -L -b C:\temp\ebay\curlcookies.txt
-c C:\temp\ebay\curlcookies.txt -e
https://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn -A "Mozilla/5.0
(Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1
(ax)"
"http://my.ebay.com/ws/eBayISAPI.dll?MfcISAPICommand=MyeBay&ssPageName=%27SIM%3ACONT%27"
------------------

I've also tried putting the 3 calls into a single command to keep the
connection open while fetching, but same thing - works perfect on
command line interactively but not when I run it as a batch script.

I've tried it on 3 different machines (all WinXP machines running latest
cURL version (7.15.4 pre-compiled binary)

-Scott
Received on 2006-07-24