.
*
*/
error_reporting(0);
if(isset($_GET["channel"])){
$name = $_GET["channel"];
}
else{
$name = "twitch";
}
$stream = "https://api.twitch.tv/kraken/streams/".$name;
$stream = json_decode(_file_get_contents_curl($stream), true);
$account = "https://api.twitch.tv/kraken/channels/".$name;
$account = json_decode(_file_get_contents_curl($account), true);
if(!$account["display_name"]){
exit("Unknown channel.");
}
if($stream["stream"] != null){
$txt = "".$stream["stream"]["channel"]["status"]."
";
$txt .= "".$account["display_name"]."
";
$txt .= "Live!
";
if(!empty($stream["stream"]["game"])){
$txt .= "Playing: ".$stream["stream"]["game"]."
";
$boxart = "http://static-cdn.jtvnw.net/ttv-boxart/".$stream["stream"]["game"].".jpg";
}else{
$boxart = "http://i.imgur.com/bwqCxgg.jpg";
}
$txt .= "Viewers: ".$stream["stream"]["viewers"]."
";
}
else{
$txt = "".$account["display_name"]."
";
$txt .= "Offline.
";
$boxart = "http://i.imgur.com/TqKeUSn.jpg";
}
$txt .= "
Go to Channel";
$return = "
".$txt." |