• 10-07-2010, 21:16:45
    #1
    arkadaşlar kendim için yazdıgım kod blogunu paylaşmak istedim yaptıgı işlev
    letitbit.netten dosyayı alıp hotfile.coma upload edip istediğim sitedeki istediğim konuya post etmesi yani letitbit linkini alıp bana ait olan hf linkini post ediyor

    burada paylsaşmamdaki amac sizlerin bu kodu daha iyi birsekilde geliştirmesidir
    suan bu vereceğim kod sadece smf 1x smf 2x sürümlerine post ediyor isteyen istediği gibi ayarlayabilir vb için ekletisinide yazdım ama bu sınıfıma eklemedim
    siz kendi isteiğinize göre editleyebilirsiniz

    biraz karışıktır..

       <?
    session_start();
    
    $linklerim = array(
    "leturl",
    "leturl"
    );
    
    $cou = count($linklerim);
    for ($i=0; $i<$cou;$i++){
    $new = new Veriler($linklerim[$i]);
    $new ->Down_Url();
    // alttaki yerlerde gerekli yerleri doldurun örnekteki gibi
    //$yeni = new SMF_1_X_ALL_Versions("http://www.phpogreniyorum.com","bytrislasis","123456","topic_no",$new->dadi ."\n". $new->dboyut ."\n". $new->uplink);    
    $yeni = new SMF_1_X_ALL_Versions("domain","username","sifre","topic_no",$new->dadi ."\n". $new->dboyut ."\n". $new->uplink);    
    }
    
    class SMF_2_X_ALL_Versions {
        public $domain;
        public $login     =     "index.php?action=login2";
        public $username;
        public $password;
        public $cookie;
        public $subject;
        public $message;
        public $random;
        public $seqnum;
        public $sesid;
        public $time;
        public $topicid;
        public $boardid;
        public $replies;
    
        
    public function __construct($domain,$username,$password,$mesaj,$topic){
    $this->domain     = $domain;
    $this->username = $username;
    $this->password = $password;
    $this->message     = $mesaj;
    $this->topicid    = $topic;
    
            $ch = curl_init();
            curl_setopt($ch,    CURLOPT_URL,$this->domain.$this->login);
            curl_setopt($ch,    CURLOPT_FOLLOWLOCATION,TRUE);
            curl_setopt($ch,    CURLOPT_POST,TRUE);
            curl_setopt($ch,    CURLOPT_POSTFIELDS,"user=$this->username&passwrd=$this->password&cookieneverexp=on&Submit=Giriş Yap");
            $this->cookie = session_id()."-".$this->username."-".$this->password.".txt";
            curl_setopt($ch,    CURLOPT_COOKIEJAR,dirname(__FILE__)."/kayitlar/".$this->cookie);
                if (file_exists(dirname(__FILE__)."/kayitlar/".$this->cookie)) {
                    
                }else{
                    curl_exec($ch);
                }
            
    }
    public function SMF_2_X(){
            $ch = curl_init();
            curl_setopt($ch,    CURLOPT_URL,$this->domain."index.php?action=post;topic=$this->topicid;$this->replies");
            curl_setopt($ch,    CURLOPT_RETURNTRANSFER,TRUE);
            curl_setopt($ch,    CURLOPT_FOLLOWLOCATION,TRUE);
            curl_setopt($ch,    CURLOPT_COOKIEFILE,dirname(__FILE__)."/kayitlar/".$this->cookie);
            $exe = curl_exec($ch);    
                
                //Mesaj Başlığı
                preg_match_all('/<input type="text" name="subject" value="(.*?)"/',$exe,$subject);
                $this->subject = $subject[1][0];            
                
                //Replies
                preg_match_all('/<input type="hidden" name="num_replies" value="(.*?)"/',$exe,$replies);
                $this->replies = $replies[1][0];            
                
                //Sessionİd
                preg_match_all("/sSessionId: '(.*?)'/",$exe,$sessionid);
                $this->sesid = $sessionid[1][0];
    
                //Random Deger        
                preg_match_all("/sSessionVar: '(.*?)'/",$exe,$random);
                $this->random = $random[1][0];            
                
                //Seqnum Deger
                preg_match_all('/<input type="hidden" name="seqnum" value="(.*?)"/',$exe,$seqnum);
                $this->seqnum = $seqnum[1][0];            
                
                
                //board Deger
                preg_match_all('/var current_board = (.*?);/',$exe,$board);
                $this->boardid = $board[1][0];
                $exe;
            
            curl_setopt($ch,    CURLOPT_URL,$this->domain."index.php?action=post2;start=0;$this->boardid");
            curl_setopt($ch,    CURLOPT_RETURNTRANSFER,TRUE);
            curl_setopt($ch,    CURLOPT_FOLLOWLOCATION,TRUE);
            curl_setopt($ch,    CURLOPT_POST,TRUE);
            curl_setopt($ch,    CURLOPT_POSTFIELDS,"topic=".  $this->topicid  ."&subject=". $this->subject ."&icon=&sel_face=&sel_size=&sel_color=&message=".$this->message."&message_mode=1&notify=0&notify=1&goback=1&attachment[]&num_replies=".$this->replies."additional_options=0&".$this->random."=".$this->sesid."&seqnum=". $this->seqnum."");
    
            echo $exe = curl_exec($ch);    
            echo $this->domain."index.php?action=post;topic=".$this->topicid;$this->replies;
    }}    
    class SMF_1_X_ALL_Versions {
    public         $Domain;    
    public         $Username;
    public         $Pass;
    public         $UserAgent      = "Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4";
    public         $Login_Url   = "index.php?action=login2";
    public       $Cookie_File;//cooike sessiondan geliyor
    public         $Topic_id;
    public         $Subject;
    public         $Message;
    public      $Icon = "xx";
    public         $FromGr;
    public         $notify;
    public         $GoBack;
    public         $Num_Replies;
    public         $Sc;
    public         $Sesid;
    public         $Seqnum;
    public         $board_id;
    public         $crack;
    public function __construct($domain,$username,$pass,$topic_id,$messsage){
                                                                                    $this ->    Domain         = $domain;
                                                                                    $this ->    Username     = $username;
                                                                                    $this ->     Pass         = $pass;
                                                                                    $this ->     Topic_id    = $topic_id;
                                                                                    $this ->      Message        = $messsage;
                                                                                    $this ->     Post_At();}
    public function Post_At (){
    $this->Cookie_File = rand();    
        $ch = curl_init();
                    curl_setopt($ch        ,CURLOPT_HEADER,0);    
                    curl_setopt($ch        ,CURLOPT_RETURNTRANSFER,1);
                    curl_setopt($ch        ,CURLOPT_URL,        $this->Domain.$this->Login_Url);
                    curl_setopt($ch        ,CURLOPT_USERAGENT,    $this->UserAgent);                
                    curl_setopt($ch        ,CURLOPT_COOKIEJAR,  dirname(__FILE__)."/Cookieler/".$this->Cookie_File); 
                    curl_setopt($ch        ,CURLOPT_COOKIEFILE, dirname(__FILE__)."/Cookieler/".$this->Cookie_File);
                    curl_setopt($ch        ,CURLOPT_FOLLOWLOCATION,1);
                    curl_setopt($ch        ,CURLOPT_POST,1);
                    curl_setopt($ch        ,CURLOPT_POSTFIELDS, "user=$this->Username&passwrd=$this->Pass&cookieneverexp=on&Submit=Giriş Yap");
                        $this12 = curl_exec($ch);
                        $REP = $this->Num_Replies +1;
                    curl_setopt($ch        ,CURLOPT_URL,$this->Domain."index.php?action=post;topic=$this->Topic_id;num_replies=$REP");
                    curl_setopt($ch     , CURLOPT_POST,0);
                        $this12 = curl_exec($ch);
    preg_match_all("/name=\"subject\" value=\"(.*?)\"/",$this12,$degerler);
        $this->Subject         = $degerler[1][0];        
    preg_match_all("/hidden\" name=\"num_replies\" value=\"(.*?)\"/",$this12,$replies);
        $this->Num_Replies     = $replies[1][0]+1;
    preg_match_all("/hidden\" name=\"sc\" value=\"(.*?)\"/",$this12,$sesid);
        $this->Sesid         = $sesid[1][0];
    preg_match_all("/hidden\" name=\"seqnum\" value=\"(.*?)\"/",$this12,$seqnum);
        $this->Seqnum         = $seqnum[1][0];    
    preg_match_all("/var current_board = (.*?);/",$this12,$board);
        $this->board_idf     = $board[1][0];            
    
                    curl_setopt($ch , CURLOPT_URL,$this->Domain."index.php?action=post2;start=0;$this->board_id");
                    curl_setopt($ch , CURLOPT_POST,1);
                    sleep(5);
                    curl_setopt($ch    , CURLOPT_POSTFIELDS,"topic=".  $this->Topic_id  ."&subject=". $this->Subject ."&icon=&message=".$this->Message."&notify=0&post=Gönder&num_replies=".$this->Num_Replies."&additional_options=0&sc=".$this->Sesid."&seqnum=". $this->Seqnum."");
                        sleep(15);
                     $this12 = curl_exec($ch);}
    }    
    class Veriler {
        var $letit_url;
        var $hf_id         = "hotfileusername";    
        var $hf_pass    = "hotfile password";    
        var $letit_pass = "letitbit password";
        var $uplink;
        var $dadi;
        var $dboyut;
                
    function __construct($url){
            $this->letit_url = $url;}        
    public  function Down_Url(){
        $ch1 = curl_init();
        curl_setopt($ch1, CURLOPT_URL,$this->letit_url);
        curl_setopt($ch1, CURLOPT_FOLLOWLOCATION,1);
        curl_setopt($ch1, CURLOPT_RETURNTRANSFER,1);
            $deger = curl_exec($ch1);
        
        preg_match_all('/<h1>(.*?)<\/h1>/',$deger,$bilgileri);
    $this->dadi     = strip_tags($bilgileri[0][0]);
    $this->dboyut     = strip_tags($bilgileri[0][1]);
    
        preg_match_all    ('/<input type="hidden" name="uid5" value="(.*?)"/'        ,$deger    ,$uid5);
        preg_match_all    ('/<input type="hidden" name="host" value="(.*?)"/'        ,$deger    ,$host);                
        preg_match_all    ('/<input type="hidden" name="optiondir" value="(.*?)"/',$deger    ,$optiondir);
        preg_match_all    ('/<input type="hidden" name="pin" value="(.*?)"/'        ,$deger    ,$pin);
        preg_match_all    ('/<input type="hidden" name="realname" value="(.*?)"/'    ,$deger    ,$realname);
        preg_match_all    ('/<input type="hidden" name="realuid" value="(.*?)"/'    ,$deger    ,$realuid);
        preg_match_all    ('/<input type="hidden" name="ssserver" value="(.*?)"/'    ,$deger    ,$ssserver);
        preg_match_all    ('/<input type="hidden" name="sssize" value="(.*?)"/'    ,$deger    ,$sssize);
        preg_match_all    ('/<input type="hidden" name="uid" value="(.*?)"/'        ,$deger    ,$uid);
        preg_match_all    ('/<input type="hidden" name="name" value="(.*?)"/'        ,$deger    ,$name);
            $uid5         = $uid5        [1][2];    
            $host         = $host        [1][2];
            $optiondir     = $optiondir[1][2];
            $pin         = $pin        [1][2];        
            $realname     = $realname    [1][2];    
            $realuid     = $realuid    [1][2];        
            $ssserver     = $ssserver    [1][2];
            $sssize     = $sssize    [1][2];    
            $uid         = $uid        [1][2];    
            $name         = $name        [1][2];
        curl_setopt($ch1,CURLOPT_URL,"http://letitbit.net/sms/check2.php");
        curl_setopt($ch1, CURLOPT_POST,1);
        curl_setopt($ch1, CURLOPT_POSTFIELDS,"pass=$this->letit_pass&uid5=$uid5&uid=$uid&name=$name&pin=$pin&realuid=$realuid&realname=$realname&host=$host&ssserver=$ssserver&sssize=$sssize&optiondir=$optiondir&pin_wm=");
            $deger = curl_exec($ch1);
        preg_match_all    ('/http:\/\/(\d.*?)\'/'    ,$deger    ,$dladres);
             $dlll =  "http://".$dladres[1][0];
        curl_close($ch1);
        
    $hotfile_user = $this->hf_id;
            $hotfile_pass = $this->hf_pass;
            $uploadlink = $dlll;
    
        $ch = curl_init();
        curl_setopt($ch , CURLOPT_TIMEOUT, 0);
        curl_setopt($ch , CURLOPT_RETURNTRANSFER , TRUE);
        curl_setopt($ch , CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; tr; rv:1.9.2) Gecko/20100115 Firefox/3.6');
        curl_setopt($ch , CURLOPT_COOKIEFILE, dirname(__FILE__).'/cookies.txt');
        curl_setopt($ch , CURLOPT_COOKIEJAR, dirname(__FILE__).'/cookies.txt');
        curl_setopt($ch , CURLOPT_FOLLOWLOCATION, TRUE);
        curl_setopt($ch , CURLOPT_URL, 'http://hotfile.com/login.php');
        curl_setopt($ch , CURLOPT_POST , TRUE);
        curl_setopt($ch , CURLOPT_POSTFIELDS, 'user='.$hotfile_user.'&pass='.$hotfile_pass);
                $exec = curl_exec($ch);
        curl_setopt($ch , CURLOPT_URL, 'http://hotfile.com/?lang=en');
            $exec = curl_exec($ch);
    
        preg_match("/http:\/\/(.*?)(.hotfile.com\/remoteupload.php\?)(.*?)\"/", $exec, $server);
            $server = $server[0];
            $server = eregi_replace("\"","", $server);
    
        curl_setopt($ch , CURLOPT_URL, $server);
        curl_setopt($ch , CURLOPT_POST , TRUE);
        curl_setopt($ch , CURLOPT_POSTFIELDS, 'uploads='. $uploadlink);
            echo $exec = curl_exec($ch);
        
        preg_match_all("/(http:\/\/(hotfile.com\/dl)(.*?)).html/", $exec, $uploadedlink);    
            $uploadedlink = $uploadedlink[0];
    $this->uplink =$uploadedlink[0];
        curl_close($ch);
        }
    }
    ?>
    $linklerim = array(
    "leturl";,
    "leturl";
    );
    buraya letitbit linklerini kaydedin


    class Veriler {
        var $letit_url;
        var $hf_id         = "hotfileusername";    
        var $hf_pass    = "hotfile password";    
        var $letit_pass = "letitbit password";
        var $uplink;
        var $dadi;
        var $dboyut;
    buraya hf id pass ve letitbit şifreniz tabi siz kendinize göre editleyeceksiniz ben kendim letitbit.netten alıyordum dosyaları

    isteyen olursa vb pm atması yeterli
  • 24-08-2010, 15:30:29
    #2
    bu auto postere eklenemez mi?