I'm trying to get channel's data from the twitch API and... for some reason it always fails :X This is the error I always get:
A PHP Error was encountered
Severity: Warning
Message: file_get_contents(https://api.twitch.tv/kraken/streams/diesel1521?client_id=******): failed to open stream: HTTP request failed! HTTP/1.1 422 Unprocessable Entity
Filename: page/home.php
Line Number: 7
I will give you a live example: http://91.139.176.200/
Page code:
$channel = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($this->streamer->getStreamerDisplayName($this->_id, true).'?client_id=******'), true);
the only variable used will always return a streamer's display name from the database. Using CodeIgniter, latest version. If anyone is asking, I have openssl, http and https enabled.