Advertisement
EkoAisyah

Respon_Like by Danz

Nov 5th, 2012
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | None | 0 0
  1. <?php
  2. $access_token = 'AAAAA***'; //biar bisa ngetag pake tokenya dari si andro => http://ellin1.16mb.com/andro.php (facebook for android)
  3. $notif = json_decode(auto('https://graph.facebook.com/fql?q='.urlencode('SELECT sender_id, title_text, object_id FROM notification WHERE recipient_id=me() AND is_hidden = 0').'&access_token='.$access_token),true);
  4. if(file_exists('responlike_log')){
  5. $log = json_encode(file('responlike_log'));
  6. }else{
  7. $log='';
  8. }
  9. for($i=1;$i<=count($notif[data])-1;$i++){
  10. if(ereg('likes your comment',$notif[data][$i-1][title_text])){
  11. if(!ereg($notif[data][$i-1][object_id].'_'.$notif[data][$i-1][sender_id],$log)){
  12. $x = $notif[data][$i-1][object_id].'_'.$notif[data][$i-1][sender_id].' ';
  13. $y = fopen('responlike_log','a');
  14. fwrite($y,$x);
  15. fclose($y);
  16. $sender_id = json_decode(auto('http://graph.facebook.com/'.$notif[data][$i-1][sender_id].'?fields=gender,name'),true);
  17. if($sender_id[gender] == 'male'){
  18. $arr_gen = array('Mas','Pakde','Kang','Mbah','Pak','Om',);
  19. $gender = $arr_gen[rand(0,count($arr_gen)-1)];
  20. }else{
  21. $arr_gen = array('Mbak','Non','Neng','Jeng',);
  22. $gender = $arr_gen[rand(0,count($arr_gen)-1)];
  23. }
  24. $exp_nam = explode(' ',$sender_id[name]);
  25. $nama = $gender.' '.$exp_nam[0];
  26. $tags = explode('_',$notif[data][$i-1][object_id]);
  27. $tag = ' @['.$tags[0].':1] ';
  28. $mess = array(
  29. 'wih, thx '.$nama.' wes nge Like Komen aku',
  30. 'walaupun bot, tapi '.$nama.' nelike komenku, thx ya',
  31. 'atur panuwun kagem '.$nama.' amargi sampun ngelike komen aku',
  32. ''.$nama.'... suka koment q ya?',
  33. 'thx '.$nama.' dah mau like komen aku',
  34. 'wow aada yang ngelike komenku',
  35. 'makasih dah like komen aku ea '.$nama,
  36. 'suka banget deh lok '.$nama.' like komenq',
  37. 'makasih '.$nama.' walopun cuma bot dah mau like komentarku',
  38. 'klo '.$nama.' like komentarq rasanya gimanaaaaaaaaa gtu',
  39. 'Dulu saya punya tahi lalat di pipi... setelah '.$nama.' like komentar dari saya... tahi lalat saya berubah jadi tahi kebo terimakasih '.$nama,
  40. 'wEw '.$nama.' like komenq... makasi ea... jd rajin komen nih di status '.$tag,
  41. );
  42. $message = '@['.$notif[data][$i-1][sender_id].':1] ,, '.$mess[rand(0,count($mess)-1)];
  43. auto('https://graph.facebook.com/'.$notif[data][$i-1][object_id].'/comments?access_token='.$access_token.'&message='.urlencode($message).'&method=post'); echo $notif[data][$i-1][object_id].' => '.$message.'<hr/>';
  44. }
  45. }
  46. }
  47.  
  48. function auto($url){
  49. $curl = curl_init();
  50. curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  51. curl_setopt($curl, CURLOPT_URL, $url);
  52. $ch = curl_exec($curl);
  53. curl_close($curl);
  54. return $ch;
  55. }
  56.  
  57. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement