// *  Programlama : Botmatik 2009
// *  Programlama Betiği : PHP
// *  Author botmatik ( Pullus ) <codemayestar [at] gmail dot com>
// *  Sexpornok.com Video Botu
// *  Contact : [url=http://www.botmatik.com]Botmatik - Türkiye'nin ilk Bot Sitesi - PHP & ASP Bot Sitesi[/url]
// *  Licensed under the GNU General Public License, version 2.
// *  See the file [url]http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt[/url]
// * Düzenleme ve  ByMst V2.0 entergre NullSoFt 
$dbhost="localhost";    // usually "localhost"
$dbname="DB_ISIM";
$dbuser="DB_KULANICI_ISIM";
$dbpass="SIFRE";
function trsil($q) { 
$q = str_replace("Ç","C",$q);
$q = str_replace ("ç","c",$q); 
$q = str_replace ("Ğ","G",$q); 
$q = str_replace ("ğ","g",$q); 
$q = str_replace ("ı","i",$q); 
$q = str_replace ("I","I",$q); 
$q = str_replace ("Ş","S",$q); 
$q = str_replace ("ş","s",$q); 
$q = str_replace ("Ö","O",$q); 
$q = str_replace ("ö","o",$q); 
$q = str_replace (".","",$q); 
$q = str_replace ("ü","u",$q); 
$q = str_replace ("Ü","U",$q); 
$q = str_replace ("'","",$q); 
$q = str_replace ("/","",$q); 
$q = str_replace (":","",$q); 
$q = str_replace ("\"","",$q);
$q = str_replace (" ","-",$q);  
$q = str_replace ("?","",$q);  
$q = str_replace ("--","-",$q);
$q = str_replace ("|","",$q); 
$q=ereg_replace("[^0-9A-Za-z-]","", $q);
$q = strtolower($q);
 return $q; 
}
class fileDownload
{
    private $fileUrl;
    private $file;
    private $dir;
    private $curl;
    private $content;
    private $fileName;
    private $fileExtension;
    private $getMsg = array();
    public function setUrlAddress($url)
    {
        $this->fileUrl = $url;
    }
    public function setDirectory($name)
    {
        if (!is_writable($name) || !is_readable($name))
        {
            $this->getMsg[] = 'Belirtmiş Olduğunuz Dizin Yazılabilir Değil';
            $this->getMsg[] = 'Belirtmiş Olduğunuz Dizin Okunabilir Değil';
        }
        else
        {
            $this->dir = $name;
        }
    }
    public function setFileName($name)
    {
        if (is_bool($name) && $name === false)
        {
            $this->fileName = preg_replace("/^(http:\/\/.*\/)?/i",'',$this->fileUrl);
        }
        else if (is_bool($name) && $name === true)
        {
            $this->fileName = md5(sha1(uniqid(mt_rand().microtime()))).'.'.$this->getFileExtension();
        }
        else
        {
            $this->fileName = $name.'.'.$this->getFileExtension();
        }
    }
    private function getFileExtension()
    {
        return preg_replace('/^(http:\/\/.*\.)?/i','',$this->fileUrl);
    }
    private function getData()
    {
        $this->curl = curl_init();
        curl_setopt($this->curl,CURLOPT_URL, $this->fileUrl);
        curl_setopt($this->curl,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT']);
        curl_setopt($this->curl,CURLOPT_RETURNTRANSFER,1);
        $this->content = curl_exec($this->curl);
        curl_close($this->curl);
    }
    public function saveData()
    {
        # Callback getData()
        $this->getData();
        # Open new file 
        $this->file = fopen($this->dir.'/'.$this->fileName,'w');
        if (fwrite($this->file,$this->content))
        {
            $this->getMsg[] = 'Dosya Kaydedildi.';
            $this->getMsg[] = 'Dosya Yolu: <i>'.$this->dir.'/'.$this->fileName.'</i>';
            return true;
        }
        else
        {
            $this->getMsg[] = 'Dosya Download Edilemedi';
            return false;
        }
    }
     public function getMessage()
    {
        echo '<ul>';
        foreach ($this->getMsg AS $value)
        {
            echo "\t<li>".$value."</li>\n";
        }
        echo '</ul>';
    }
}
$syf=10;
for ($s=1;$s<=$syf;$s++)
    $site = "http://kraloyun.com/"; //Site Adresi
    $where = "Kategori/Cocuk/1";  // Hangi Kategori
    $connect = file_get_contents($site.($where)); // Bağlantı
    preg_match_all('#<div style="margin: 4px 4px 0px 4px; padding: 0; ">(.*?)</div>#si',$connect,$open,PREG_SET_ORDER);
    for($i=0; $i<16; $i++){ // Kaç Adet
    $gel= $open[$i][1];
    $ikinci = $gel; // Lazım olan kısmı Parse Ettik
    preg_match_all('#<a href="/(.*?)">#si',$ikinci,$pars,PREG_SET_ORDER);
    preg_match_all('#<img src="(.*?)" class="cat0011" alt="(.*?)" title="(.*?)">#si',$ikinci,$pare,PREG_SET_ORDER);
    for($x=0; $x<1; $x++){ // Değerler
    $aa = $pars[$x][1]; //Link Kodu
    $ab = $pare[$x][1]; // Img Kodu
    $ac = $pare[$x][3]; // Title Kodu
    $swfadres = $aa; // swf için adres alıyoruz
    $reconnect = file_get_contents($site.($swfadres)); // Bağlantı
    preg_match_all('#http://cdn.kaisergames.de/PageKraloyun/flash/Games/(.*?).swf#si',$reconnect,$swflink,PREG_SET_ORDER);
    $av=$swflink[$x][1];
    $oyunlink="http://yig.vo.llnwd.net/o25/kaisergames/PageKraloyun/flash/Games/".$av.".swf";
   $seo = trsil($ac);
echo "---------------------";
$file = new fileDownload;
$file->setUrlAddress($ab);
$file->setDirectory('thumbs');
$file->setFileName($seo);
if ($file->saveData()){
$file->getMessage();
}else{
$file->getMessage();
}
$ZAM=date("Y-m-d H:i:s");
$oyuncuklink="http://www.rahatoyun.com/swfs/".$seo.".swf";
$thumblink="http://www.rahatoyun.com/thumbs/".$seo.".jpg";
echo "---------------------";
$file = new fileDownload;
$file->setUrlAddress($oyunlink);
$file->setDirectory('swfs');
$file->setFileName($seo);
if ($file->saveData()){
$file->getMessage();
}else{
$file->getMessage();
}
$conn=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname) or die ("Unable to connect to MySQL");
$insert = mysql_query ("INSERT INTO oyun (id, adi, tarih, seo, hit, kategori, aciklama, resim, oyun, onay) 
VALUES('', '$ac', '$ZAM', '$seo', '1', 'Cocuk', '$ac', '$thumblink', '$oyuncuklink', 1)");
if ($insert) { echo "EKLENDI...<br>"; } else { echo "EKLENEMEDi... ".mysql_error(); }
mysql_close($conn);
}}
// *  Programlama : Botmatik 2009
// *  Programlama Betiği : PHP
// *  Author botmatik ( Pullus ) <codemayestar [at] gmail dot com>
// *  Sexpornok.com Video Botu
// *  Contact : [url=http://www.botmatik.com]Botmatik - Türkiye'nin ilk Bot Sitesi - PHP & ASP Bot Sitesi[/url]
// *  Licensed under the GNU General Public License, version 2.
// *  See the file [url]http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt[/url]
// * Düzenleme ve  ByMst V2.0 entergre NullSoFt
NOT: sqlda Cocuk olan yer sizin kategoridir. baska kategoriden cekerseniz ona gore degistirin.
NOT2: SWF ve THUMB server aliyor.
swfs ve thumbs klasorler olusturun botun calismasi icin.
kodu <?
?> arasina atip bot.php olarak kayit edin calisir.


NOT3: botun calismasi icin swfs ve thumbs klasorler acmaniz lazim oyunlar ve resimler oraya geliyor.

Sonra
$where = "Kategori/Cocuk/1"; // Hangi Kategori

Cocuk olan yer kraloyun.comda kategoridir 1 rakami 2 yaparsan 2 sayfadan oyunlari ceker ve oyle devam eder 3 4 5.


Sqlin icinde gecen 'Cocuk' kelimesi oda oyunlar hangi kategoriye eklenicek gosteriyor, eger indirme kategorisini degistirirseniz orayida degistirin.

$oyuncuklink="http://www.rahatoyun.com/swfs/".$seo.".swf";
$thumblink="http://www.rahatoyun.com/thumbs/".$seo.".jpg";

rahatoyun.com olan yeri sizin site isimle degistirin

Sorun ve soru varsa buraya yada PM ile sorunuz