Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $access_token= "EAAAAAYsX7TsBAF3vpx8yeebx4i9kzLN3jLyVDQRnhyKzxQSZBO0Anscrne9ngZBmxiMDaEGVpX70gPD8tHxZAPI0DD7efzRVP9hCvKZBkpb9qWx0SOXvKBYI1XRBGezMkrKyN2vXPjY3sgeWo62XVpKLYM8wi1r726ZBUDnOGch44NaNHA01UoJzgfKbl5cG7er8GxHLCrruLZCwgxiymH";
- $me=json_decode(auto('https://graph.facebook.com/me?access_token='.$access_token.'&fields=id'),true);
- $stat = json_decode(auto('https://graph.facebook.com/me/home?fields=id,from,message&access_token='.$access_token.'&offset=0&limit=100'),true);
- if(file_exists('jakrapp.txt')){ $log = json_encode(file('jakrapp.txt')); }else{ $log=''; }
- for($i=1;$i<=count($stat[data]);$i++){ $com = json_decode(auto('https://graph.facebook.com/'.$stat[data][$i-1][id].'/comments?access_token='.$access_token.'&limit=500&fields=id,message,from'),true);
- if(count($com[data]) > 0){ for($c=1;$c<=count($com[data]);$c++){ if(ereg($com[data][$c-1][id],$log)){ echo' udah di respon njeng !! <hr/>';
- }else{ $logx = $com[data][$c-1][id].' ';
- $logy = fopen('jakrapp.txt','a');
- fwrite($logy,$logx);
- fclose($logy);
- $gen=json_decode(auto('http://graph.facebook.com/'.$com[data][$c-1][from][id].'?fields=gender'),true);
- if($gen[gender] == 'male'){ $arr_gen=array(' Mas ',' Om ',' Kang ',' Mbah ',' Eyang ',);
- }else{
- $arr_gen=array(' Miss ',' Eyang ',' Non ',' Neng ',);
- }
- $iniapa=explode(' ',$com[data][$c-1][from][name]);
- $mumet = ''.$arr_gen[rand(0,count($arr_gen)-1)].'';
- $nama = ' '.$mumet.' '.$com[data][$c-1][from][name].'';
- $tag = ''.$com[data][$c-1][from][name].'';
- $kata=$com[data][$c-1][message];
- $urut = count($com[data]) + 1;
- $banner = '.';
- $arr_mess = simsimi($kata);
- $message= ' '.$com[data][$c-1][from][name].' : '.$arr_mess.'';
- $message_ken = $message;
- if($com[data][$c-1][from][id] != $me[id]) {
- $rsp[$i][] = urlencode($message_ken);
- }
- }
- }
- }
- if(!empty($rsp[$i])){ $respon = implode('%0a',$rsp[$i]);
- auto('https://graph.facebook.com/'.$stat[data][$i-1][id].'/comments?access_token='.$access_token.'&message='.$respon.'+'.urlencode($banner).'&method=post');
- //auto('https://graph.facebook.com/'.$com[data][$c-1][id].'/likes?access_token='.$access_token.'&method=post'); // hilangin " // " sebelum auto kalo mau like komen
- //auto('https://graph.facebook.com/'.$com[data][$i-1][id].'/pokes?access_token='.$access_token.'&method=post'); // hilangin " // " sebelum auto kalo mau jadi maho
- }
- }
- function simsimi($str){
- $jakrapp = array("tes");
- $url="http://sandbox.api.simsimi.com/request.p?key=e3871e24-5965-48e4-918a-f84671fabc80&lc=id&ft=1.0&text=".urlencode($str);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; Linux i686) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.52 Safari/536.5");
- $exec = curl_exec($ch);
- curl_close($ch);
- $dec = json_decode($exec, true);
- if(empty($dec)){
- echo $dec;
- return null;
- }else{
- if(!empty($dec['response'])) $simi=$dec['response'];
- else{
- echo $exec;
- return "UP GAN!!";
- }
- if(strcmp($simi, "Aing teu nyaho eta bahasa.")==0)$preg=$jakrapp[array_rand($jakrapp)];
- elseif(preg_match("/You are too fast to answer|Terlalu cepat\! Kita akan berbicara sedikit lambat/is", $simi))$preg=$jakrapp[array_rand($jakrapp)];
- else $preg=preg_replace("/simsimi|simi|.simi|sim/is", " Jaka Taruna ", $simi);
- return $preg;
- }
- }
- function auto($url){
- $curl = curl_init();
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($curl, CURLOPT_URL, $url);
- $ch = curl_exec($curl);
- curl_close($curl);
- return $ch;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement