I`m still not really comfortable with PHP and furthermore completly new to Json. What i want to do is check out if a specific Twitch.tv Livestream is online or not, also i want to get the viewers. Twitch.tv has its own API ( https://github.com/justintv/Twitch-API/wiki/API ) with which, this should be possible. Here is my first approach:
// Twitch Streams
else if($typ == 't') {
$api = file_get_contents("https://api.twitch.tv/kraken/streams/".$stream_id);
$json = json_decode($api);
if($json->stream != null) {
return true;
}
else {
return false;
}
}
The problem is that file_get_contents seem to not understand https, it claimes that the wrapper is not installed. The thing is that normal http requests are not supported by the API, so i guess i have to use another function. Can somebody suggest me a different (not so hard to use) function. I have read about curl and fsocket but they seem a bit difficult to use for me.