| Registrarse | Members | Calendar | Buscar |
manipulating yahoo address book php script (help) |
![]() |
| Herramientas | Buscar en Tema | Desplegado |
| |||
|
I'm working on a script that automatically adds an email address into a given account's address book. Although I pass all the post variables using curl (including the randomly generated ones) the effect is not as wanted. I post the code below, please if someone can help I'd be very happy. Código: <?php
function add($email_id, $password) {
// URL
$url = "https://login.yahoo.com/config/login?";
$agent = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$ja = rand(1, 100000);
$cookie_file_path = $ja .".txt";
$query_string = ".tries=2&.src=ym&.md5=&.hash=&.js=&.last=&promo=&.intl=us&.bypass=";
$query_string .= "&.partner=&.u=4eo6isd23l8r3&.v=0&.challenge=gsMsEcoZP7km3N3NeI4mX";
$query_string .= "kGB7zMV&.yplus=&.emailCode=&pkg=&stepid=&.ev=&hasMsgr=1&.chkP=Y&.";
$query_string .= "done=http%3A%2F%2Fmail.yahoo.com&login=$email_id&passwd=$password";
$url_login = $url . $query_string;
// end URL
// login
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url_login);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_HEADER , 1);
$response = curl_exec ($ch);
curl_close ($ch);
unset($ch);
// End login
// open addr book
$addressbook_url="http://address.yahoo.com/yab/us?addcontact";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'https://login.yahoo.com/config/login?');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
//curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_URL, $addressbook_url);
$addresstr = curl_exec($ch);
echo $addresstr."
";
curl_close($ch);
$crumbstart=strpos($addresstr,".crumb")+26;
$fcontactstart=strpos($addresstr,"fcontact")+17;
$fcontact=substr($addresstr,$fcontactstart,1110);
$postfcontact="fcontact=".$fcontact;
$crumb=substr($addresstr,$crumbstart,11);
$postcrumb=".crumb=".$crumb;
echo $postfcontact."
";
echo $postcrumb."
";
// end read addr book
// add email
//$addurl="http://address.yahoo.com/yab/index.php?1&VPC=add";
$addurl="http://address.yahoo.com/yab/index.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, 'http://www.yahoo.com');
curl_setopt($ch, CURLOPT_POSTFIELDS, '1');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'VPC=add');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'A=m');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'clp_s=');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'clp_g=');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'clp_c=');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'clp_b=');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postcrumb);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'displayphone=1&displayhome=1&displaywork=1&displaydate=1&displaynotes=1&displaymsgr=1');
curl_setopt($ch, CURLOPT_POSTFIELDS, '_charset_');
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfcontact);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'id=0&rev_id=0');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'fields[email]=email@toadd.com');
curl_setopt($ch, CURLOPT_POSTFIELDS, 'submit[action_save]=Save');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_URL, $addurl);
$addstr = curl_exec($ch);
echo $addstr;
curl_close($ch);
// end add email address
@unlink($cookie_file_path);
}
add($_REQUEST["user"],$_REQUEST["pass"]);
?>
|
| Recomendamos |
| |||
|
Um.... ok I guess I'm missing something. What is it not doing now that you would like it to do?
__________________ . . <--- If you have any questions, See Avatar |
| |||
|
it does login without problems, it opens the Add Contact page, it extracts the randomly generated .crumb and fcontact then I try to submit the form in attempt to insert that email into address book... (I think) I passed all the post variables correctly.. but the form executes without adding the email and throws into contacts list... (that would also display if called address yahoo. com /yab/ index.php without any parameters) i guess i'm missing something.. the code can be tested, it only needs chmod 777 on folder to write cookie |
| |||
|
Hmmm... I'll have to look into it. Meanwhile, you may want to go through and analyze the yab.js (Yahoo Address Book JavaScript) file for possible clues. http://us.js2.yimg.com/us.js.yimg.com/lib/pim/r/abook/yab3/1_5/all/yab.js
__________________ . . <--- If you have any questions, See Avatar |
![]() |
| Etiquetas |
| address, book, manipulating, php, script, yahoo |
| Herramientas | Buscar en Tema |
| Desplegado | |
| |
Temas Similares | ||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| IP Address Searcher 2.12 | Snake | Cracks, Serials y Keygens | 0 | 17-feb-2008 18:50 |
| IP Address Searcher | Snake | Cracks, Serials y Keygens | 0 | 13-feb-2008 00:50 |
| Adelio flash guest book Script wanted | thenewtrend | ScriptZ | 0 | 16-abr-2007 00:54 |
| Yahoo Time Capsule - Script...? | jarod1981 | ScriptZ | 0 | 08-nov-2006 15:32 |
| Address book import from yahoo, hotmail, gmail etc | imported_karma | ScriptZ | 2 | 21-sep-2006 03:01 |
| Registrarse | Ayuda | Miembros | Calendario | Buscar | Temas de Hoy | Marcar Foros Como Leídos |