PDA

View Full Version : Ebay Script: CURL in HTTPS [HELP PLEASE]



NahiaN
11 Sep 2006, 07:28 AM
I need your help to fix a single thing about CURL in HTTPS.


<form method="post" name="single" id="single"> <input type="hidden" name="do" value="single">ysers: <textarea name="userb"><?php echo $_POST['userb']; ?></textarea> <input type="submit" value="Extract"></form> <form method="post" name="lici" id="lici"><input type="hidden" name="do" value="lici" />ebay lici: <textarea name="linkb"><?php echo $_POST['linkb']; ?></textarea> <input type="submit" value="Extract" /></form> <?php set_time_limit(0); ini_set("memory_limit","64M"); if (!(function_exists('curl_init'))) { echo("<b><font size=5>Error: cURL not installed.</font></b>"); exit; } if($_SERVER["REQUEST_METHOD"] == POST) { $user = ''; //ebay username $pass = ''; //ebay password $linkb = $_POST['linkb']; $userb = $_POST['userb']; $do = $_POST['do']; $cookie = "cookie-".rand(1000,100000); function curl($url, $cookie='', $post='') { $rand = rand(100000,400000); $agent = "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/".$rand." Netscape/7.1 (ax)"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_USERAGENT, $agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); if($post !== '') if($cookie !== '') { curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $result = curl_exec ($ch); curl_close ($ch); if($result == "") { curl($url, $cookie, $post); } else { return $result; } } function login($user, $pass) { global $cookie; $getcookie = curl("https://signin.ebay.com/ws/eBayISAPI.dll?SignIn", $cookie); // echo $getcookie; // exit; $login = curl("https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&co_partnerid=2&siteid=0&UsingSSL=1&pageType=&pa1=&i1=&bshowgif=&UsingSSL=&ru=&pp=&pa2=&errmsg=&runame=&ruparams=&ruproduct=&sid=&favoritenav=&confirm=&ebxPageType=&existingEmail=&isCheckout=&migrateVisitor=", $cookie, "MfcISAPICommand=SignInWelcome&siteid=0&co_partnerId=2&UsingSSL=1&i1=-1&pageType=-1&userid=".$user."&pass=".$pass); // https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&co_partnerId=2&pUserId=&siteid=0&pageType=&pa1=&i1=&bshowgif=&UsingSSL=&ru=http%3A%2F%2Fwww.ebay.com&pp=&pa2=&errmsg=&runame=&ruparams=&ruproduct=&sid=&favoritenav=&confirm=&ebxPageType=&existingEmail=&isCheckout=&migrateVisitor= echo $login; if(strpos($login, "Hello,") !== false) { return true; } else { @unlink($cookie); return false; } } function extractemail($userid) { global $user, $cookie; $get = curl("cgi3.ca.ebay.com/ws/eBayISAPI.dll", $cookie, "MfcISAPICommand=LeaveMultiplseFeedback&userid=".$user."&pass=&which0=positive&i0=0000000000&ouser0=".$userid."&transactid0=8806049833&confirm0=0"); $mail = explode("mailto:", $get); $mail = explode('">', $mail[1]); if(strpos($get, "default&amp;iid=0") !== false) { $mail[0] = ''; } return $mail[0]; } function extractbids($id) { $get = curl("http://offer.ebay.com/ws/eBayISAPI.dll?ViewBids&item=".$id); foreach(explode('<td><a href="http://feedback.ebay.com/ws/eBayISAPI.dll?ViewFeedback&userid=', $get) as $bids) { if(strpos($user[0], "</table>") === false) { $users .= $user[0]."\n"; } } return array_unique(explode("\n", $users)); } if(login($user, $pass) == false) { echo "i can't login"; exit(); } if($do == 'single') { foreach(explode("\n", $userb) as $userbb) { echo extractemail(trim($userbb))."<br>"; } } if($do == 'lici') { foreach(explode("\n", $linkb) as $linkbb) { $bids = extractbids(trim($linkbb)); foreach($bids as $users) { echo extractemail($users)."<br>"; } } } @unlink($cookie); } ?>