I have a stream section on my website (http://www.wasdgamer.com)
And in the sidebar I have a list of streams, I would like to add whether or not the stream is onAir/offAir, I have found the following code but would like to make the channel name a variable based on the stream title. (e.g. ../streams/channelname)
$json_file = file_get_contents(“http://api.justin.tv/api/stream/list.json?channel=ChannelName“, 0, null, null);
$json_array = json_decode($json_file, true);
if ($json_array[0]['name'] == ‘live_user_ChannelName‘) {
echo ‘Live stream is online!’;
}
else {
echo ‘Live stream is offline!’;
}
If you understand what I'm asking for any help would be appreciated, if not let me know and I will try to explain better :]