[Solved] Is kraken no more?

EDIT: Please disregard. Big dumb brain over here. I had restructured my template without telling myself and forgot to declare $twitch_channel so the calls were obviously undefined. Leaving here in case anyone needs to a quick template. Code below includes all the missing variables haha.

Hey, so I have a few sites that have been working fine for a while, but got some reports of undefined errors. Every single one is affected, and I use a template I put together so I wouldn’t have to constantly rewrite Twitch integrations.

I’m assuming the Kraken endpoint isn’t valid anymore? Nothing has changed and I’m seeing no syntax issues.

Could someone tell me what’s improper here, as I’m not grasping why everything is all of a sudden undefined.

$twitch_channel = 'CodeSpent';
$clientID = ' ';

// Grabs title, url, avater, game, and followers.
$twitch = json_decode(curl_get_file_contents('https://api.twitch.tv/kraken/channels/'.$twitch_channel.'?client_id='.$clientID), true);
$display_name = $twitch['display_name'];
$game = $twitch['game'];
$status = $twitch['status'];
$url = $twitch['url'];
$avatar = $twitch['logo'];
$views = $twitch['views'];
$followers = $twitch['followers'];


// Grabs stream status
$stream = json_decode(curl_get_file_contents('https://api.twitch.tv/kraken/streams/'.$twitch_channel.'?client_id='.$clientID), true);
$viewers = $stream['stream']['viewers'];
$online = false;
if ($stream['stream'] != NULL) {
$online = true;}

// Sets website metadata to Twitch profile data
$profile = json_decode(curl_get_file_contents('https://api.twitch.tv/kraken/users/'.$twitch_channel.'?client_id='.$clientID), true);
$bio = $profile['bio'];

function curl_get_file_contents($URL){
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
curl_close($c);
if ($contents) return $contents;
else return FALSE;}

// Grabs referrall info
$referral="http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$version = '1.1';

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