Displaying Members of Twitch Community

Id like to use my snippet from below to display who is live streaming for the community and or the members.

?php
$channels = array(“fatpally”, “dyannatv”, “mongervog”) ;
$callAPI = implode(",",$channels);
$clientID = ‘MYTWITCHCLIENTID’;
$arrContextOptions=array(
“ssl”=>array(
“verify_peer”=>false,
“verify_peer_name”=>false,
),
);
$dataArray = json_decode(file_get_contents(‘https://api.twitch.tv/kraken/streams?channel=’ . $callAPI . ‘&client_id=’ . $clientID, false, stream_context_create($arrContextOptions)), true);

foreach($dataArray[‘streams’] as $mydata){

if($mydata[’_id’] != null){
$name = $mydata[‘channel’][‘display_name’];
$game = $mydata[‘channel’][‘game’];
$url = $mydata[‘channel’][‘url’];

echo “ONLINE”;
}
}
if($dataArray[‘streams’] == null or $dataArray[‘streams’] == “”)
{
echo “OFFLINE”;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.