Client ID Update - Updating old plugin - Help

Thank you so much for your help. Those are some great solutions and im actively trying them out right now. I fully understand if this plugin is a bit messy but it worked so well before the crackdown and it is the only plugin i have found that does what i need it to do on my site. That’s why i am so eager to bring it back to life. Also again, this all could be do to my in experience here as well. So @kaugesaar i have applied your solution and this is what i still get.

Now, i changed file_get_contents in that string you gave and this is the result after.

Fatal error: Allowed memory size of 268435456bytes exhausted (tried to allocate 64 bytes) in /home/content(blah blah)/plugins/twitchwp/inc/twitch.php on line 15

Here is how i placed it in the code, right under the class:

<?php

class Twitch {

public function getContents($url) {
$clientID = ‘axjhfp777tflhy0yjb5sftsil’;

$opts = array(
  'http' => array(
    'method' => "GET",
    'header' => "Client-ID: $clientID"
  )
);
$context = stream_context_create($opts);
return file_get_contents($url, false, $context);

}

public function getApiUri($type) {
$apiUrl = “https://api.twitch.tv/kraken”;
$apiCalls = array(
“streams” => $apiUrl.“/streams/”,
“search” => $apiUrl.“/search/”,
“channel” => $apiUrl.“/channels/”,
“user” => $apiUrl.“/user/”,
“teams” => $apiUrl.“/teams/”,
“games” => $apiUrl.“/games/top”,
“search” => $APIURL.“/search/”
);
return $apiCalls[$type];
}

I may not have explained this but this is a Worldpress plugin, So im starting to think that i need to change other things other then just on the main php file that calls to the api. Being that this uses short codes within WP pages i might be calling on this wrong to get these responses.