Advertisement
RieqyNS13

respon_f.php

Mar 2nd, 2014
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.32 KB | None | 0 0
  1. <?php
  2. set_time_limit(0);
  3. class rieqyns13{
  4.     public $consumer_key;
  5.     public $consumer_secret;
  6.     public $access_token;
  7.     public $access_token_secret;
  8.     public $_count;
  9.     public $send_msg;
  10.     public $save_id;
  11.     function con(){
  12.         require_once("lib/twitteroauth.php");
  13.         $con = new TwitterOAuth($this->consumer_key, $this->consumer_secret, $this->access_token, $this->access_token_secret);
  14.         return $con;
  15.     }
  16.     function simpan($id){
  17.         $fp = fopen($this->save_id, "a") or die("error cok");
  18.         fwrite($fp, $id);
  19.         fclose($fp);
  20.     }
  21.     function check($id){
  22.         if(!file_exists($this->save_id)){
  23.             $fp = fopen($this->save_id, "a");
  24.             fclose($fp);
  25.         }
  26.         $file = file($this->save_id);
  27.         $file = str_replace(array("\n", "\r", "\r\n"), "", $file);
  28.         if(in_array($id, $file))return false;
  29.         else return true;
  30.     }
  31.     function gay(){
  32.         echo "[+]Proses.....\n";
  33.         $con = $this->con();
  34.         $mbuh = $con->get("followers/ids", array("cursor" => "-1", "count"=>$this->_count));
  35.         foreach($mbuh->ids as $ids){
  36.             $gay = $con->get("friendships/show", array("source_id"=>$ids, "target_screen_name"=>"RieqyNS13"));
  37.             if($gay->relationship->source->followed_by==false && $gay->relationship->target->following==false){
  38.                 if($this->check($ids)){
  39.                     echo "[+]ID {$ids} belum ada di daftar, mulai follow\n";
  40.                     $info = $con->get("users/show", array("user_id"=>$ids));
  41.                     $screen_name = $info->screen_name;
  42.                     $name = $info->name;
  43.                     $foll = $con->post("friendships/create", array("user_id"=>$ids, "follow"=>true));
  44.                     echo "[~]Berhasil follow id ".$ids."({$screen_name})\n";
  45.                     if($this->send_msg){
  46.                         echo "[~]Kirim mention aktif\n";
  47.                         $post = $con->post("statuses/update", array("status" => "@{$screen_name} Thanks for your following. I've been following you back \n #BotRieqyNS13"));
  48.                         if(!empty($post->text)){
  49.                             echo "[~]Sukses send mention\n";
  50.                         }else{
  51.                             echo "[~]Error: ".$post->errors[0]->message."\n";
  52.                         }
  53.                     }
  54.                 }else echo "[+]ID {$ids} sudah ada di daftar\n";
  55.                 $this->simpan($ids."\n");
  56.             }else{
  57.                 echo "[+]ID {$ids} sudah difollow\n";
  58.             }
  59.        
  60.        
  61.         }
  62.     }
  63. }
  64. $bot = new rieqyns13;
  65. $bot->_count=5; //ojo akeh2 cok
  66. $bot->save_id="follow.id";
  67. $bot->send_msg=true;
  68. $bot->consumer_key="";
  69. $bot->consumer_secret="";
  70. $bot->access_token="";
  71. $bot->access_token_secret="";
  72. $bot->gay();
  73. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement