Not sure why, but I grabbed this code from another thread which is now close and it doesn’t matter with which accounts (even live ones) they all appear as offline. I just copy/paste straight into PHP, please help.
Is there something else that needs to be done in order to work properly?
$live = array();
$channels = array("themittanidotcom", "djyumene", "mym_alkapone", "Rightrevgoldstein", "daopa", "streamerhouse", "cabochardlol", "moanygamer", "bajheera", "lelaaone", "Old_Bearded_Gamer");
// This part does stuff ... and things! No touchie!
$streamData = json_decode(@file_get_contents("https://api.twitch.tv/kraken/streams?channel=".implode(",",$channels)), true);
foreach ($channels as $name) {
$live[$name] = null;
}
foreach ($streamData["streams"] as $stream) {
$live[$chdata["channel"]["name"]] = $stream;
}
foreach ($live as $name => $stream) {
if($stream != null){
$game = $stream['channel']['game'];
$logo = $stream['channel']['logo'];
$viewers = $stream['viewers'];
echo "<p><img src='$logo' height='45' width='45' style='float:left;'><a href='http://twitch.tv/$name/embed' target='tbox'><font style='font-size: 1rem;line-height: 1.4;white-space: nowrap;font-weight: 700;color: #B9A3E3;text-decoration: none;font-family: 'Open Sans',sans-serif;'>$name</font></a><br><font style='font-size: 0.75rem;line-height: 1;white-space: nowrap;font-weight: 700;color: #3366FF;text-decoration: none;font-family: 'Open Sans',sans-serif;'>Playing: <img src='online.png' height='7' width='7'> $game<br>Viewers: $viewers</font></p>";
} else{
echo "<p><img src='$logo' height='45' width='45' style='float:left;'><a href='http://twitch.tv/$name/embed' target='tbox'><font style='font-size: 1rem;line-height: 1.4;white-space: nowrap;font-weight: 700;color: #B9A3E3;text-decoration: none;font-family: 'Open Sans',sans-serif;'>$name</font></a><br><font style='font-size: 0.75rem;line-height: 1;white-space: nowrap;font-weight: 700;color: #3366FF;text-decoration: none;font-family: 'Open Sans',sans-serif;'>Playing: <img src='offline.png' height='7' width='7'> Offline<br><br></font></p>";
}
}