Hello,
How can i get informations like profil picture when stream is offline ?
$channelName = ******;
$json_array = json_decode(file_get_contents(‘https://api.twitch.tv/kraken/streams/’.strtolower($channelName)), true);
if ($json_array['stream'] != null) {
$currentGame = $json_array['stream']['channel']['game'];
$channelTitle = $json_array['stream']['channel']['display_name'];
$streamTitle = $json_array['stream']['channel']['status'];
$viewers = $json_array['stream']['viewers'];
$logo = $json_array['stream']['channel']['logo'];
}
It’s work when the stream is online,but not when stream is offline
I have search and the stream key is always null when stream is offline.So what can i do?
Thank’s for your helps,
Edit : Solve