Advertisement
dodioutright

V.1.3.3

Feb 22nd, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.14 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3.  
  4. $token='TOKET_JANDA'; /* kalo ga punya janda, bini orang juga gpp */
  5.  
  6. $type='LOVE'; /* pilih salah satu saja SAD, LOVE, LIKE, ANGRY, WOW */
  7. $likekomen=false; /* ubah TRUE untuk mengaktifkan like komentar */
  8.  
  9.  
  10. class pro{
  11.  
  12. public function _req($url){
  13.    $opts = array(
  14.             19913 => 1,
  15.             10002 => $url,
  16.             10018 => 'IDBTE4MBotReaction',
  17.             );
  18.    $ch=curl_init();
  19.    curl_setopt_array($ch,$opts);
  20.    $result = curl_exec($ch);
  21.    curl_close($ch);
  22.    return $result;
  23.   }
  24.  
  25. function getData($dir,$token,$params){
  26.     $param = array(
  27.         'access_token' => $token,
  28.         );
  29.    if($params){
  30.        $arrayParams=array_merge($params,$param);
  31.        }else{
  32.        $arrayParams =$param;
  33.        }
  34.    $url = $this->getUrl('graph',$dir,$arrayParams);
  35.    $result = json_decode($this->_req($url),true);
  36.    if($result[data]){
  37.        return $result[data];
  38.        }else{
  39.        return $result;
  40.        }
  41.    }
  42.  
  43. private function getUrl($domain,$dir,$uri=null){
  44.    if($uri){
  45.        foreach($uri as $key =>$value){
  46.            $parsing[] = $key . '=' . $value;
  47.            }
  48.        $parse = '?' . implode('&',$parsing);
  49.        }
  50.    return 'https://' . $domain . '.facebook.com/' . $dir . $parse;
  51.    }
  52.  
  53. private function getLog($x,$y){
  54. if(!is_dir('log')){   mkdir('log');   }
  55.    if(file_exists('log/'.$x.'.txt')){
  56.        $log=file_get_contents('log/'.$x.'.txt');
  57.        }else{
  58.        $log=' ';
  59.        }
  60.  
  61.   if(ereg($y[id],$log)){
  62.        return false;
  63.        }else{
  64. if(strlen($log) > 5000){
  65.    $n = strlen($log) - 5000;
  66.    }else{
  67.   $n= 0;
  68.    }
  69.        $this->saveFile('log/'.$x.'.txt',substr($log,$n).' '.$y[id]);
  70.        return true;
  71.       }
  72.  }
  73.  
  74. private function saveFile($x,$y){
  75.    $f = fopen($x,'w');
  76.              fwrite($f,$y);
  77.              fclose($f);
  78.    }
  79.  
  80. public function like($c,$r,$token){
  81. $home=$this->getData('me/home',$token,array(
  82.    'fields' => 'id,from,comments.limit(50),comments.id',
  83.    'limit' => 20,
  84.    )
  85. );
  86. $check = json_decode($this->_req('https://graph.facebook.com/me?access_token='.$token),true);
  87. if(!$check[id]){
  88. echo ' ->Modar'; }
  89.  
  90. foreach($home as $post){
  91.    if($r=='random'){
  92.    $ran=array('LOVE','WOW','HAHA','SAD','ANGRY');
  93.     $mess = $ran[rand(0,count($ran)-1)];
  94.    }else{ $mess=$r; }
  95.      if($post[id]){ if($this->getLog($me,$post) && $me!=$post[from][id]){
  96.           print '<a href="//fb.com/'.$post[from][id].'">'.$post[from][name].'</a> <b>'.$mess.'</b>';
  97.           print '<br>';
  98.           $this->getData($post[id].'/reactions',$token,array(
  99.                         'type' => $mess,
  100.                         'method' => 'post',
  101.                          )
  102.                  );
  103.  
  104.            } }
  105.  
  106. if($c==1){
  107. $b = count($post[comments][data]);
  108.  
  109. if($b >0){
  110. print ' '.$b.' comment<br>';
  111. if( $b > 5){ $a = $b - 5; }else{ $a=0; }
  112. for($i=$a;$i<$b;$i++){ if($post[comments][data][$i][id]){
  113. if($this->getLog($me,$post[comments][data][$i])){
  114. $this->getData($post[comments][data][$i][id].'/likes',$token,array('method'=>'post'));
  115. }
  116. }
  117. }
  118. }
  119. }
  120. }
  121. }
  122.  
  123. }
  124. $bot=new pro();
  125.     echo $bot->like($likekomen,$type,$token);
  126.    
  127.    
  128.    
  129.  
  130. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement