Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by TwitchTV Stream Status Sc ( 14 years ago )
<?php
$channel = "tival";       
$json_file = @file_get_contents&#40;"http://api.justin.tv/api/stream/list.json?channel={$channel}", 0, null, null&#41;;
$json_array = json_decode($json_file, true);
 
if ($json_array[0]['name'] == "live_user_{$channel}")
{ 
 echo "Online (".$json_array[0]['channel_count']." viewers)";
}
else
{
 echo "Offline";
}
?>

 

Revise this Paste

Your Name: Code Language: