| Events |
|
|
|
|
|
|
|
|
| Services |
|
|
|
|
|
|
|
|
| Interact |
|
|
| -
|
| -
|
|
|
| About Us |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[vox-tech] PHP / CURL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[vox-tech] PHP / CURL
I want to access my half.ebay.com account automatically from my linux
machine. As far as I learned till now, if I manually login once with
firefox browser and then use the firefox cookies I can easily get any
https webpages with wget:
wget --load-cookies
~/.mozilla/firefox/6fv0lggm.default/cookies.txt
https://account.half.ebay.com/ws/eBayISAPI.dll?MyAccountSummary
But the problem is that this cookie expires every 24 hour and I have to
manually log in once a day, just to refresh the cookies.txt file; which
is a pain and that's what I'm doing now!
Fortunately, I found the following piece of php code in some ebay forum
a few days a go. I went thru php and curl webpages to figure out what
should I do, but still I have NO IDEA how to use this code :-)
help! I even don't know if it works or not!
***********************************************************************************************************************************
$ebay_user_id = "yourusername"; // ebay id
$ebay_user_password = "yourpassword"; // ebay password
$emailaddress = ""; //email address status about uploads will goto
$cookie_file_path = "cookie"; // cookie file (dont bother changing)
// 1 - Get the Cookies required to login from the welcome login page
$LOGINURL = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn";
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
$result = curl_exec ($ch);
curl_close ($ch);
// 2 - Post Login Cookies and Login Information to Page http://signin.ebay.com/aw-cgi/eBayISAPI.dll
$LOGINURL = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll";
$POSTFIELDS =
'MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=0&ru=&pp=&pa1=&pa2=&pa3=&i1=-1&pageType=-1&userid='.
$ebay_user_id .'&pass='. $ebay_user_password;
$reffer = "http://signin.ebay.com/aw-cgi/eBayISAPI.dll?SignIn";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$POSTFIELDS);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_REFERER, $reffer);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
$result = curl_exec ($ch);
***********************************************************************************************************************************
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech
|
|