Advertisement
DedsecID

auto komen fb

Dec 21st, 2016
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.07 KB | None | 0 0
  1. <?php
  2.  
  3. #####config######
  4. $bot['like'] = true;
  5. $bot['ck_k'] = true;
  6. $bot['ck_u'] = true;
  7. $bot['time'] = true;
  8. $bot['aces'] = file_get_contents("config.txt");
  9. ###############com_like($cl,$ck,$cu,$tm,$access_token)
  10.  
  11. ##
  12.  
  13. com_like($bot['like'],$bot['ck_k'],$bot['ck_u'],$bot['time'],$bot['aces']);
  14.  
  15. #####komentar####
  16. function cmn($text,$ck,$cu){
  17. ##########umum
  18. $cmn_umum = array("Nyimak :V",
  19. );
  20. ##########kondisi
  21. $comment = array(
  22. array(
  23.       array("",
  24.            )
  25.      ),
  26. );
  27. $komentar = '';
  28. $cr_kondisi=false;
  29. foreach($comment as $cx){
  30.     foreach($cx[0] as $ct){
  31.         if(ereg($ct,$text)){
  32.             $cr_kondisi=false;
  33.             $komentar = $cx[1][rand(0,count($cx[1]) - 1)];
  34.         }
  35.     }
  36. }
  37. if($cr_kondisi==true && $ck==true){
  38.     return $komentar;
  39. }else{
  40.     if($cu==true){ return $cmn_umum[rand(0,count($cmn_umum) - 1)]; }
  41. }
  42. }
  43. ###############
  44. function com_like($cl,$ck,$cu,$tm,$access_token){
  45.     $beranda = json_decode(httphit("https://graph.facebook.com/me/home?fields=id,from,type,message&limit=100&access_token=".$access_token))->data;
  46.     $saya_cr = json_decode(httphit("https://graph.facebook.com/me?access_token=".$access_token));
  47.     if($beranda){
  48.         foreach($beranda as $cr_post){
  49.             if(!ereg($saya_cr->id,$cr_post->id)){
  50.                 $log_cr = simlog($cr_post->id);
  51.                 if($log_cr==true){
  52.                     if($ck==true){
  53.                         $url_ck = cmn($cr_post->message,$ck,$cu);
  54.                         $url_ck = str_replace("<name>",$cr_post->from->name,$url_ck);
  55.                         if($tm==true){ $url_ck = $url_ck.wkthit(); }
  56.                         $url_ck = urlencode($url_ck);
  57.                         if($ck==true OR $cu==true){
  58.                             httphit("https://api.facebook.com/method/stream.addComment?post_id=".$cr_post->id."&comment=".$url_ck."&access_token=".$access_token);
  59.                         }
  60.                         if($cl==true){
  61.                             httphit("https://api.facebook.com/method/stream.addLike?post_id=".$cr_post->id."&access_token=".$access_token);
  62.                         }
  63.                     }
  64.                 }
  65.             }
  66.         }
  67.     }
  68. }
  69. ###############
  70. function httphit($url){
  71.     return file_get_contents($url);
  72. }
  73. function wkthit(){
  74.     $ent="
  75. ";
  76. }
  77. function simlog($cr_id) {
  78.     $fname = "cr_log.txt";
  79.     $lihatiplist=fopen ($fname, "rb");
  80.     $text='';
  81.     if($lihatiplist){
  82.         $spasipol = "";
  83.         do {
  84.             $barislistip = fread($lihatiplist, 512);
  85.             if(strlen($barislistip) == 0){ break; }
  86.             $spasipol .= $barislistip;
  87.         } while(true);
  88.         fclose ($lihatiplist);
  89.         for ($i = 1; $i <= 10; $i++) {$spasipol = str_replace(" ","",$spasipol);}
  90.         $text=$text.$spasipol;
  91.     }else{$text="";}
  92.     if(ereg($cr_id,$text)){
  93.         return false;
  94.     }else{
  95.         $text = $text.$cr_id;
  96.         $w_file=@fopen($fname,"w") or bberr();
  97.         if($w_file) {
  98.             @fputs($w_file,$text);
  99.             @fclose($w_file);
  100.         }
  101.         return true;
  102.     }
  103. }
  104. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement