Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/07/2011, 19:43
tokiodata
 
Fecha de Ingreso: mayo-2008
Mensajes: 287
Antigüedad: 15 años, 11 meses
Puntos: 2
curl + php login

intento logearme con curl a mi cuenta de yahoo con un script que me encontre en google, el problema es que siempre me sale que mi contraseña es incorrecta el code es este

Código:
<?php
    $serviceUrl = "http://calendar.yahoo.com/";
    $authUrl    = "http://login.yahoo.com/config/login?";
    $userAgent  = "YahooSeeker-Testing/v3.9 (compatible; Mozilla 4.0; MSIE 5.5; http://search.yahoo.com/)";
    $referer    = "http://my.yahoo.com";
    $login      = "[email protected]";
    $password   = "password";
    $numPostData = 22;
    $cookieFileJar  = "cookie.txt";
    $cookie = 0;
    $postData = "login=$login&passwd=$password&.src=&.tries=5&.bypass=&.partner=&.md5=&.hash=&.intl=us&.tries=1&.challenge=ydKtXwwZarNeRMeAufKa56.oJqaO&.u=dmvmk8p231bpr&.yplus=&.emailCode=&pkg=&stepid=&.ev=&hasMsgr=0&.v=0&.chkP=N&.last=&.done=" . $serviceUrl;

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);

    // Set the referrer
    curl_setopt($ch, CURLOPT_REFERER, $referer);

    // Set the authentication url
    curl_setopt($ch, CURLOPT_URL, $authUrl);

    // Set number of post fields
    curl_setopt($ch, CURLOPT_POST, $numPostData);

    //Set post data in key=value pair such as login=yourusername
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);

    //Set filename for storing cookie information
    curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFileJar);

    //Set ffilename for checking the stored cookie information
    curl_setopt($ch, CURLOPT_COOKIEFILE, $cookieFile);

    //Set option for cookie
    curl_setopt($ch, CURLOPT_COOKIE, $cookie);
 
 //set this to output the result as string and not output directly ot browser
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

 //set this value to 1 if you want to redirect to the url you provided as service url
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
 
 //Set this option if you do not want to verify ssl
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
 
 //set this option if you do not want to verify peer's certificate
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
 
 //now execute the curl
    $res = curl_exec($ch);
curl_close($ch);
echo $res;
?>
se supone que si se estan enviando los datos correctamente pero no se cual sea el problema, alguien me podria ayudar ?