buyrun basit bir şekilde wordpress hali

<?php
##
# * @author dnmtnk @wp-uyarlama b4tuh4n
# * @copyright 2008-10-20
## 
# Buffer
# -------------
ob_start();
# Database Ayarları ilk önce wordpress kurun
# --------------------
$db['host'] = 'localhost';
$db['user'] = 'root';
$db['pass'] = '';
$db['dbnm'] = 'wordpressdatabasename';
# Mysql'e Bağlan
# ----------------
mysql_connect($db['host'],$db['user'],$db['pass']) or die(mysql_error().' Mysql Bağlantı Hatası');
mysql_select_db($db['dbnm']) or die(mysql_error().' Mysql Veritabanı Seçme Hatası');
# Hedef Site Ayarları
# ----------------------
$site = 'http://www.pembemp3.com/mp3.php?id=';
# Başlangıç ve Bitiş ID
# ------------------------
$id = (!$_GET['id'] ? '1' : $_GET['id']);
$sonid = 5495;
# Bekleme Süresi
# ---------------
$bekle = 0;
# Bilgileri Oku
# ----------------
function getData($url)
{
    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,$url);
    curl_setopt($ch,CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
    $content = curl_exec($ch);
    curl_close($ch);
    return $content;
}
# Mp3 Başlığı Al
# ------------------
function getMp3NameAndUrlAddress($content)
{
    preg_match("#<h1><a .*href=.(.*).>(.*)<\/a><\/h1>#i",$content,$return);
    return array(
        'mp3Url' => $return[1],
        'mp3Name' => $return[2]
    );
}
# Gelen Bilgileri Kaydet
# -------------------------
function saveData($mp3Name,$mp3Url)
{
    $mp3Name = mysql_real_escape_string($mp3Name);
    $mp3Url  = mysql_real_escape_string($mp3Url);
    $addToSql = mysql_query("INSERT INTO wp_posts(post_title,post_content) VALUES ('".$mp3Name."','".$mp3Url."')");
    if ($addToSql !== false)
    {
        return true;
    }
    else
    {
        return false;
    }
}
# Başlatma Fonksiyonu
# ---------------------
function Start()
{
    global $site,$id,$sonid,$bekle;
    $getContent = getData($site.$id);
    $mp3 = getMp3NameAndUrlAddress($getContent);
    if ($id != $sonid)
    {
        if (trim($mp3['mp3Name']) == '-')
        {
            $id++;
            header('Refresh:'.$bekle.' url='.$_SERVER['SCRIPT_NAME'].'?id='.$id);
            echo '<h1>'.$id.' Numaralı Kayıt Sitede Yok. Bir Sonrakine Geçiliyor...</h1>';
        }
        else
        {
            if (saveData($mp3['mp3Name'],$mp3['mp3Url']))
            {
                $id++;
                header('Refresh:'.$bekle.' url='.$_SERVER['SCRIPT_NAME'].'?id='.$id);
                echo '<h1>'.$mp3['mp3Name'].'-'.$mp3['mp3Url'].' Kaydedildi.Tesekkrler batuhan Bir Sonrakine Geçiliyor...</h1>';
            }
            else
            {
                header('Refresh:'.$bekle.' url='.$_SERVER['SCRIPT_NAME'].'?id='.$id);
                echo '<h1>'.$mp3['mp3Name'].'-'.$mp3['mp3Url'].' Kaydedilemedi. Yeniden Deneniyor...</h1>';
            }            
        }
    }
    else
    {
        echo '<h1>Pempe Mp3 Sitesi Bilgileri Alındı.</h1>';
    }
}
# Başla
# -------------
Start();
# Buffer End
# ----------------
ob_end_flush();
?>