$url = $_SERVER["HTTP_REFERER"];
$xml .= "\n";
function t_v($url) {
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$ch = curl_init();
$timeout = 30;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
@ $file = curl_exec($ch);
curl_close($ch);
return $file;
}
$fname = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER["SCRIPT_NAME"];
if (isset($_GET['id'])) {
$strt = @file_get_contents('http://www.zhanqi.tv' . $_GET['id'] . '');
preg_match('#window.gameId = (.*?);#',$strt,$vid);
$a = 'http://www.zhanqi.tv/api/static/game.lives/'.$vid[1].'/1000-1.json';
$b = @file_get_contents($a);
$json = json_decode($b,true);
$zonghe = $json['data']['rooms'];
$f = count($zonghe);
for($m=0;$m
$xml.='' . PHP_EOL;
}
}
else {
$a = 'http://www.zhanqi.tv/games';
$v = file_get_contents($a);
preg_match_all('//imsU', $v, $str);
preg_match_all('//imsU', $v, $str1);
preg_match_all('/
([^"]+)/imsU', $v, $mz);
foreach ($str[1] as $k => $v) {
$xml.= '' . PHP_EOL;
}
}
$xml.= "";
echo $xml;
?>