karena saya tidak menggunakan bot koment jadinya bot ini gak terlalu kerasa sama aqnya
buat teman2 yang pengen nyoba silakan dicicipi
<?php
$anu = array('Waduh Terimakasih Banyak ya <nama> ,Udah Mau like Comentar Ku.. xixixiii','asik comentku dah di like sama <nama> makacih yaa','<nama> makacih jempolna yaa','suka deh <nama> kamu like comentku','percaya deh kalau <nama> emang jempoler sejati','sekalian di like juga yaa <nama> status caya','meskipun saya cuma robot terimaksih yaa <nama> dah like comentku');
$pesan = $anu[rand(0,count($anu) - 1)];
$n = 10;
function bacaHTML($url){
$data = curl_init();
curl_setopt($data, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($data, CURLOPT_URL, $url);
$hasil = curl_exec($data);
curl_close($data);
return $hasil;
}
function cr_selisih($time){
$update_time = gmdate('H:i:s', $time);
$time = time();
$selisih = strtotime($update_time) - strtotime($time);
$menit = floor($selisih/60);
$detik = $selisih % 60;
return $selisih;
}
$astok = 'token di sini'; //akses token yang tidak expired
$q='SELECT notification_id, sender_id, title_text, object_id, body_html, object_type, created_time, href FROM notification WHERE recipient_id=me() AND is_unread = 1 AND is_hidden = 0';
$fql = str_replace(" ","+",$q);
$url ='https://graph.facebook.com/fql?q='.$fql.'&access_token='.$astok; // graph untuk tampilkan notifikasi
$kodeHTML = bacaHTML($url); // menjalankan fungsi curl diatas
$beranda = (array)json_decode($kodeHTML); // mendapatkan bentuk array dari format json
for($i=0; $i<= $n-1; $i++) // mengulang sebanyak 3 kali untuk mendapatkan 3 record
{
$notif['notif_id'][$i] = $beranda['data'][$i]->notification_id;
$notif['object_id'][$i] = $beranda['data'][$i]->object_id;
$notif['sender_id'][$i] = $beranda['data'][$i]->sender_id;
$notif['title_text'][$i] = $beranda['data'][$i]->title_text;
$notif['link'][$i] = $beranda['data'][$i]->link;
$notif['updated_time'][$i] = $beranda['data'][$i]->created_time;
}
for($i=0; $i<= $n-1; $i++)
{
$str = $notif['title_text'][$i];
$cari = 'likes your comment';
if(strpos($str, $cari) === false){
// gak sah ngoment
}else{
echo "<br>".$cr_selisih = cr_selisih($notif['updated_time'][$i]);
$url = 'https://graph.facebook.com/'.$notif['sender_id'][$i];
$coba = bacaHTML($url);
$data = (array)json_decode($coba);
$nama = $data['name'];
$comment = str_replace("<nama>",$nama,$pesan);
echo $comments = str_replace(" ","+",$comment);
$url_comment = 'https://api.facebook.com/method/stream.addComment?post_id='.$notif['object_id'][$i].'&comment='.$comments.'&access_token='.$astok;
$ch = curl_init($url_comment);
$content = curl_exec($ch);
curl_close($ch);
$url_notif = 'https://api.facebook.com/method/notifications.markRead?notification_ids='.$notif['notif_id'][$i].'&access_token='.$astok;
$chi = curl_init($url_notif);
$contenti = curl_exec($chi);
curl_close($chi);
}
}
?>
silakan liat koleksi bot DISINI
0 komentar:
Posting Komentar