And here is an example of how to create a php function to replace file_get_contents:
<?php
$clientID = array(
‘Client-ID: 0000000000000000000000000000000’
);
function file_get_contents_curl($url) {
$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, $clientID);
$data = curl_exec($ch); curl_close($ch);
return $data;
}
$apiCALL = json_decode(@file_get_contents_curl(‘https://api.twitch.tv/kraken/channels/matt_thomas/follows?limit=1’), true);
$follower = $apiCALL[‘follows’][‘0’][‘user’][‘name’];
echo $follower;
?>