Advertisement
RieqyNS13

bot dc2

Apr 11th, 2013
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.80 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set("Asia/Jakarta");
  3. class rieqyns13{
  4.     var $str;
  5.     var $user;
  6.     var $pass;
  7.     var $user_x;
  8.     var $pass_x;
  9.     var $user_agent = "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0";
  10.     var $url_login = "http://devilzc0de.org/forum/index.php";
  11.     var $url_post = "http://devilzc0de.org/forum/xmlhttp.php";
  12.     var $url_smile = "http://devilzc0de.org/forum/misc.php?action=smilies&popup=true&editor=clickableEditor";
  13.     var $header = array("Host: www.simsimi.com",
  14.         "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0",
  15.         "Accept: application/json, text/javascript, */*; q=0.01",
  16.         "Accept-Language: id,en-us;q=0.7,en;q=0.3",
  17.         "Accept-Encoding: gzip, deflate",
  18.         "Content-Type: application/json; charset=utf-8",
  19.         "X-Requested-With: XMLHttpRequest",
  20.         "Referer: http://www.simsimi.com/talk.htm",
  21.         "Cookie: JSESSIONID=0C448762EDC29F8BDA953CE66C7DEF38; __utma=119922954.1601026049.1365342288.1365342288.1365348819.3; __utmc=119922954; __utmz=119922954.1365342288.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); sagree=true; __utmb=119922954.2.9.1365348830995",
  22.         "Connection: keep-alive",
  23.         "HTTP/1.1 200 OK");
  24.     var $cookie;
  25.     var $cookie_2;
  26.     var $file;
  27.    
  28.     function simsimi($cookie){
  29.         $str = str_replace(":", "", $this->str);
  30.         $ch = curl_init();
  31.         curl_setopt($ch, CURLOPT_URL, "http://www.simsimi.com/func/req?msg=".urlencode($str)."&lc=id&sagree=true");
  32.         curl_setopt($ch, CURLOPT_HTTPHEADER, $this->header);
  33.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  34.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  35.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  36.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
  37.         $a = curl_exec($ch);
  38.         curl_close($ch);
  39.         $exp = json_decode($a, true);
  40.         if(empty($exp)){
  41.             $c = "apa itu gan ? ane gak pernah denger";
  42.             return $c;
  43.         }else{
  44.             $c = $exp['response'];
  45.             $simi = str_replace(array("simi"), "ane", $c);
  46.             return $simi;
  47.         }
  48.     }
  49.  
  50.     function login($username, $password, $cookie){
  51.         $data = array("action" => "do_login", "username" => $username, "password" => $password, "loginsubmit" => "Login!");
  52.         $ch = curl_init();
  53.         curl_setopt($ch, CURLOPT_URL, $this->url_login);
  54.         curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent);
  55.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  56.         curl_setopt($ch, CURLOPT_POST, 1);
  57.         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  58.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  59.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  60.         $exec = curl_exec($ch);
  61.         curl_close($ch);
  62.         return $exec;
  63.     }
  64.     function smiles(){
  65.         $ch = curl_init();
  66.         curl_setopt($ch, CURLOPT_URL, $this->url_smile);
  67.         curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent);
  68.         curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  69.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  70.         $exec = curl_exec($ch);
  71.         $remove_html = strip_tags($exec);
  72.         $pecah = explode("Click a smilie to insert it into your message", $remove_html);
  73.         $hapus =  str_replace(array("[", "]", "close window", "\n", "\r", "\r\n"), " ", $pecah[1]);
  74.         $hapus2 = preg_replace("/\s+/", " ", $hapus);
  75.         $smiles = explode(" ",trim($hapus2));
  76.         return $smiles;
  77.         curl_close($ch);
  78.     }
  79.     function post($str, $cookie){
  80.         $data = array("action" => "add_shout", "shout_data" => $str);
  81.         $ch = curl_init();
  82.         curl_setopt($ch, CURLOPT_URL, $this->url_post);
  83.         curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent);
  84.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  85.         curl_setopt($ch, CURLOPT_POST, 1);
  86.         curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
  87.         curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
  88.         curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
  89.         $exec = curl_exec($ch);
  90.         curl_close($ch);
  91.         return $exec;
  92.     }
  93.     function logs($post, $post_x, $data){
  94.         $fp = fopen($this->file, "a");
  95.         $fw = fwrite($fp, date("d-m-Y H:i:s")."\n".$this->user."-->".$this->str."-->".$post."\n".
  96.         $this->user_x."-->".$data."-->".$post);
  97.         fclose($fp);
  98.         return $fw;
  99.     }
  100.     function bot(){
  101.         $login[0] = $this->login($this->user, $this->pass, $this->cookie);
  102.         $login[1] = $this->login($this->user_x, $this->pass_x, $this->cookie_2);
  103.         if($login[0] && $login[1]){
  104.             $smiles = $this->smiles();
  105.             $data = $this->simsimi($this->cookie_2)." ".$smiles[rand(0, count($smiles)-1)];
  106.             $post[0] = $this->post($this->str, $this->cookie);
  107.             $post[1]= $this->post($data, $this->cookie_2);
  108.             echo $this->user." -> ".$this->str." -> ".$post[0]."\n".
  109.             $this->user_x." -> ".$data." -> ".$post[1]."\n";
  110.             $this->logs($post[0], $post[1], $data); //kirim logs
  111.         }
  112.     }
  113. }
  114. $bot = new rieqyns13();
  115. $bot->str = ":garing"; //isi pesan shoutbox
  116. $bot->user = "username";
  117. $bot->pass = "password";
  118. $bot->user_x = "bot_username";
  119. $bot->pass_x = "bot_password";
  120. $bot->cookie = "/tmp/cookie.txt";  //tidak boleh sama dengan cookie_2
  121. $bot->cookie_2 = "/tmp/cookie2.txt";
  122. $bot->file = "logs.txt";
  123. $bot->bot();
  124. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement