Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- $token='TOKET_JANDA'; /* kalo ga punya janda, bini orang juga gpp */
- $type='LOVE'; /* pilih salah satu saja SAD, LOVE, LIKE, ANGRY, WOW */
- $likekomen=false; /* ubah TRUE untuk mengaktifkan like komentar */
- class pro{
- public function _req($url){
- $opts = array(
- 19913 => 1,
- 10002 => $url,
- 10018 => 'IDBTE4MBotReaction',
- );
- $ch=curl_init();
- curl_setopt_array($ch,$opts);
- $result = curl_exec($ch);
- curl_close($ch);
- return $result;
- }
- function getData($dir,$token,$params){
- $param = array(
- 'access_token' => $token,
- );
- if($params){
- $arrayParams=array_merge($params,$param);
- }else{
- $arrayParams =$param;
- }
- $url = $this->getUrl('graph',$dir,$arrayParams);
- $result = json_decode($this->_req($url),true);
- if($result[data]){
- return $result[data];
- }else{
- return $result;
- }
- }
- private function getUrl($domain,$dir,$uri=null){
- if($uri){
- foreach($uri as $key =>$value){
- $parsing[] = $key . '=' . $value;
- }
- $parse = '?' . implode('&',$parsing);
- }
- return 'https://' . $domain . '.facebook.com/' . $dir . $parse;
- }
- private function getLog($x,$y){
- if(!is_dir('log')){ mkdir('log'); }
- if(file_exists('log/'.$x.'.txt')){
- $log=file_get_contents('log/'.$x.'.txt');
- }else{
- $log=' ';
- }
- if(ereg($y[id],$log)){
- return false;
- }else{
- if(strlen($log) > 5000){
- $n = strlen($log) - 5000;
- }else{
- $n= 0;
- }
- $this->saveFile('log/'.$x.'.txt',substr($log,$n).' '.$y[id]);
- return true;
- }
- }
- private function saveFile($x,$y){
- $f = fopen($x,'w');
- fwrite($f,$y);
- fclose($f);
- }
- public function like($c,$r,$token){
- $home=$this->getData('me/home',$token,array(
- 'fields' => 'id,from,comments.limit(50),comments.id',
- 'limit' => 20,
- )
- );
- $check = json_decode($this->_req('https://graph.facebook.com/me?access_token='.$token),true);
- if(!$check[id]){
- echo ' ->Modar'; }
- foreach($home as $post){
- if($r=='random'){
- $ran=array('LOVE','WOW','HAHA','SAD','ANGRY');
- $mess = $ran[rand(0,count($ran)-1)];
- }else{ $mess=$r; }
- if($post[id]){ if($this->getLog($me,$post) && $me!=$post[from][id]){
- print '<a href="//fb.com/'.$post[from][id].'">'.$post[from][name].'</a> <b>'.$mess.'</b>';
- print '<br>';
- $this->getData($post[id].'/reactions',$token,array(
- 'type' => $mess,
- 'method' => 'post',
- )
- );
- } }
- if($c==1){
- $b = count($post[comments][data]);
- if($b >0){
- print ' '.$b.' comment<br>';
- if( $b > 5){ $a = $b - 5; }else{ $a=0; }
- for($i=$a;$i<$b;$i++){ if($post[comments][data][$i][id]){
- if($this->getLog($me,$post[comments][data][$i])){
- $this->getData($post[comments][data][$i][id].'/likes',$token,array('method'=>'post'));
- }
- }
- }
- }
- }
- }
- }
- }
- $bot=new pro();
- echo $bot->like($likekomen,$type,$token);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement