Estoy intentando actualizar Tuenti con Curl, pero lo único que consegui fue que el servidor me dijera que no actualizaba porque le parecia sospechoso.
Codigo:
Alguien sabe como arreglarlo?
Codigo:
Código (php) [Seleccionar]
<?php
$handler = curl_init();
curl_setopt($handler, CURLOPT_POST, false);
curl_setopt($handler, CURLOPT_COOKIEJAR,"cookie.txt");
curl_setopt($handler, CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($handler, CURLOPT_URL, "http://m.tuenti.com/?m=login");
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_FRESH_CONNECT, true);
curl_setopt($handler, CURLOPT_COOKIESESSION, "cookie.txt");
$prueba = curl_exec($handler);
$handler = curl_init();
curl_setopt($handler, CURLOPT_POST,true);
curl_setopt($handler, CURLOPT_COOKIEJAR,"cookie.txt");
curl_setopt($handler, CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($handler, CURLOPT_URL, "http://m.tuenti.com/?m=login&func=process_login");
curl_setopt($handler, CURLOPT_POSTFIELDS,"tuentiemail=EMAILDETUENTI&password=PASSWORDDETUENTI");
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_FRESH_CONNECT, true);
curl_setopt($handler, CURLOPT_COOKIESESSION, "cookie.txt");
$prueba = curl_exec($handler);
$handler = curl_init();
curl_setopt($handler, CURLOPT_POST,false);
curl_setopt($handler, CURLOPT_COOKIEJAR,"cookie.txt");
curl_setopt($handler, CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($handler, CURLOPT_URL, "http://m.tuenti.com/");
curl_setopt($handler, CURLOPT_USERAGENT,"Mozilla/5.0 (Linux; U; Android 2.2; en-us; T-Mobile G2 Build/FRF91) AppleWebKit/533.1(KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
curl_setopt($handler, CURLOPT_HTTPHEADER, array("Accept-Language: es-es,es;q=0.8", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Proxy-Connection: keep-alive", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3"));
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_FRESH_CONNECT, true);
curl_setopt($handler, CURLOPT_COOKIESESSION, "cookie.txt");
$prueba = curl_exec($handler);
preg_match('/(csfr=)([a-zA-Z0-9]{8})/', $prueba, $total);
$texto = urlencode("ñ");
$handler = curl_init();
curl_setopt($handler, CURLOPT_POST,true);
curl_setopt($handler, CURLOPT_COOKIEJAR,"cookie.txt");
curl_setopt($handler, CURLOPT_COOKIEFILE,"cookie.txt");
curl_setopt($handler, CURLOPT_COOKIESESSION, "cookie.txt");
curl_setopt($handler, CURLOPT_URL, "http://m.tuenti.com/?m=Profile&f=processSetStatus&csrf=$total[2]");
curl_setopt($handler, CURLOPT_USERAGENT,"Mozilla/5.0 (Linux; U; Android 2.2; en-us; T-Mobile G2 Build/FRF91) AppleWebKit/533.1(KHTML, like Gecko) Version/4.0 Mobile Safari/533.1");
curl_setopt($handler, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded","Content-Length: 23","Host: m.tuenti.com","Accept-Language: es-es,es;q=0.8", "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Proxy-Connection: keep-alive", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3"));
curl_setopt($handler, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handler, CURLOPT_REFERER, "http://m.tuenti.com/?m=Profile&f=processSetStatus&csrf=$total[2]");
curl_setopt($handler, CURLOPT_POSTFIELDS,"from=Home&status=$texto");
$response = curl_exec($handler);
echo $response;
?>
Alguien sabe como arreglarlo?