str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.simsimi.com/func/req?msg=".urlencode($str)."&lc=id&sagree=true"); curl_setopt($ch, CURLOPT_HTTPHEADER, $this->header); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $a = curl_exec($ch); curl_close($ch); $exp = json_decode($a, true); if(empty($exp)){ $c = "apa itu gan ? ane gak pernah denger"; return $c; }else{ $c = $exp['response']; $simi = str_replace(array("simi"), "ane", $c); return $simi; } } function login($username, $password, $cookie){ $data = array("action" => "do_login", "username" => $username, "password" => $password, "loginsubmit" => "Login!"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->url_login); curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); $exec = curl_exec($ch); curl_close($ch); return $exec; } function smiles(){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->url_smile); curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $exec = curl_exec($ch); $remove_html = strip_tags($exec); $pecah = explode("Click a smilie to insert it into your message", $remove_html); $hapus = str_replace(array("[", "]", "close window", "\n", "\r", "\r\n"), " ", $pecah[1]); $hapus2 = preg_replace("/\s+/", " ", $hapus); $smiles = explode(" ",trim($hapus2)); return $smiles; curl_close($ch); } function post($str, $cookie){ $data = array("action" => "add_shout", "shout_data" => $str); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $this->url_post); curl_setopt($ch, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie); $exec = curl_exec($ch); curl_close($ch); return $exec; } function logs($post, $post_x, $data){ $fp = fopen($this->file, "a"); $fw = fwrite($fp, date("d-m-Y H:i:s")."\n".$this->user."-->".$this->str."-->".$post."\n". $this->user_x."-->".$data."-->".$post); fclose($fp); return $fw; } function bot(){ $login[0] = $this->login($this->user, $this->pass, $this->cookie); $login[1] = $this->login($this->user_x, $this->pass_x, $this->cookie_2); if($login[0] && $login[1]){ $smiles = $this->smiles(); $data = $this->simsimi($this->cookie_2)." ".$smiles[rand(0, count($smiles)-1)]; $post[0] = $this->post($this->str, $this->cookie); $post[1]= $this->post($data, $this->cookie_2); echo $this->user." -> ".$this->str." -> ".$post[0]."\n". $this->user_x." -> ".$data." -> ".$post[1]."\n"; $this->logs($post[0], $post[1], $data); //kirim logs } } } $bot = new rieqyns13(); $bot->str = ":garing"; //isi pesan shoutbox $bot->user = "username"; $bot->pass = "password"; $bot->user_x = "bot_username"; $bot->pass_x = "bot_password"; $bot->cookie = "/tmp/cookie.txt"; //tidak boleh sama dengan cookie_2 $bot->cookie_2 = "/tmp/cookie2.txt"; $bot->file = "logs.txt"; $bot->bot(); ?>