RieqyNS13 icon

bot dc2

RieqyNS13 | PRO | 04/11/13 06:13:40 AM UTC | 0 ⭐ | 436 👁️ | Never ⏰ | []
PHP |

4.8 KB

|

None

|

0 👍

/

0 👎

<?php
date_default_timezone_set("Asia/Jakarta");
class rieqyns13{
    var $str;
    var $user;
    var $pass;
    var $user_x;
    var $pass_x;
    var $user_agent = "Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0";
    var $url_login = "http://devilzc0de.org/forum/index.php";
    var $url_post = "http://devilzc0de.org/forum/xmlhttp.php";
    var $url_smile = "http://devilzc0de.org/forum/misc.php?action=smilies&popup=true&editor=clickableEditor";
    var $header = array("Host: www.simsimi.com",
        "User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:21.0) Gecko/20100101 Firefox/21.0",
        "Accept: application/json, text/javascript, */*; q=0.01",
        "Accept-Language: id,en-us;q=0.7,en;q=0.3",
        "Accept-Encoding: gzip, deflate",
        "Content-Type: application/json; charset=utf-8",
        "X-Requested-With: XMLHttpRequest",
        "Referer: http://www.simsimi.com/talk.htm",
        "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",
        "Connection: keep-alive",
        "HTTP/1.1 200 OK"); 
    var $cookie;
    var $cookie_2;
    var $file;
    
    function simsimi($cookie){
        $str = str_replace(":", "", $this->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();
?>

Comments