Просмотр поста #14965: Мануал по написанию грабберов!

.
~XeOn~

Decadence,

define ('_IN_JOHNCMS', TRUE);
require '../incfiles/core.php';
define ('DIR', dirname($_SERVER['PHP_SELF']));
define ('URI', strtr($_SERVER['REQUEST_URI'], array(DIR . '/' => '')));
if(strstr(URI, 'track/') !== false)
    define ('URL', 'http://play.zaycu.ru/' . URI);
else
    define  ('URL', 'http://play.zaycu.ru/charts/' . URI);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, URL);
curl_setopt($ch, CURLOPT_RETURNTRANSWER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$response = curl_exec($ch);
curl_close($ch);

$response = strtr($response, array('href="/charts' => 'href="' . DIR, 'href="/track' => 'href="' . DIR . '/track'));

require '../incfiles/head.php';
echo $response;
require '../incfiles/end.php';