<?phpSintax diatas, itu kita melakukan login melalui yahoo mobile.
// get home page of yahoo mobile
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, “http://us.m1.yahoo.com/p/login”);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
// do login to yahoo messenger (mobile version)
$yahoo_id = “ID YM PENGIRIM”; // your yahoo id
$yahoo_id_password = “PSS YM PENGIRIM”; // your yahoo id password
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, “http://us.m1.yahoo.com/p/login/auth?ignore=signin”);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, “_done=&_pc=&_src=&_ts=&_sig=&_css=&_intl=&_second_user=no&username=” . $yahoo_id . “&password=” . $yahoo_id_password . “&action=Sign+in”);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
// get home page of mobile messenger
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, “http://us.m1.yahoo.com/p/messenger”);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
// get home page url of mobile messenger with contact lists
$url_get = $curl_data;
$url_get = substr($url_get, strpos($url_get, “/p/messenger”));
$url_get = substr($url_get, 0, strpos($url_get, “\”"));
$url_get = “http://us.m1.yahoo.com” . urldecode($url_get);
// get home page of mobile messenger with contact lists
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url_get);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
// persiapan untuk mendapatkan variable untuk send message yahoo messenger
$url_get = $curl_data;
$url_get = substr($url_get, strpos($url_get, “/p/messenger/chat?”));
$url_get = substr($url_get, 0, strpos($url_get, “\”"));
$url_get = “http://us.m1.yahoo.com” . urldecode($url_get);
// akses ke form send message yahoo messenger
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url_get);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
// preparation for get post url for send message
$post_url = $curl_data;
$post_url = substr($post_url, strpos($post_url, “action=”) + 8);
$post_url = substr($post_url, 0, strpos($post_url, “\”"));
$post_url = “http://us.m1.yahoo.com” . urldecode($post_url);
// target yahoo id and message
$yahoo_username = “YM PENERIMA”;
$yahoo_message = “PESAN”;
// do send message to target yahoo id
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $post_url);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, “user=” . $yahoo_username . “&message=” . $yahoo_message . “&wmlfix=Send”);
curl_setopt($curl, CURLOPT_ENCODING, “”);
curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . ‘/cookies_yahoo_messenger.cookie’);
$curl_data = curl_exec($curl);
curl_close($curl);
echo “pesan Anda sudah terkirim ke Yahoo! ID: ” . $yahoo_username;
?>
Lalu apa yang harus saya edit?
$yahoo_id = “ID YM PENGIRIM”; // your yahoo idID YM PENGIRIM = Ganti dengan id yahoo messenger anda
$yahoo_id_password = “PSS YM PENGIRIM”; // your yahoo id password
PSS YM PENGIRIM = Ganti dengan password id yahoo messenger anda digunakan untuk login
$yahoo_username = “YM PENERIMA”;YM PENERIMA = Diganti dengan id YM orang yang ingin kita kirim pesan
$yahoo_message = “PESAN”;
PESAN = Diganti dengan pesan yang akan anda kirim
Gagal nih...
BalasHapus