Here is a cURL example (Add this function and append _curl to all your file_get_contents.)
<?php
/* file_get_contents replaced with curl function - Add this function and replace any use of file_get_contents with file_get_contents_curl */
function file_get_contents_curl($url) {
$curlHeader = array(
"Client-ID: XXXXXXXXXXXXXXXXXXXXXXXX", /* SET CLIENT ID HERE */
"Accept: application/vnd.twitchtv.v5+json",
"Authorization: OAuth xxxxxxxxxxxxxxxxxxxxxxxxxxx"
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeader);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
?>