Hello! there is a code that should receive information from the twitch channel
<?$channelName = htmlspecialchars($_GET['channel'], ENT_QUOTES); //Получаем ID здесь http://www.twitch.tv/settings?section=applications $clientId = 'dreamhackcs'; //подставляем значение в переменную online $online = 'Online'; //подставляем значение в переменную offline $offline = 'Offline'; $json_array = json_decode(file_get_contents('https://api.twitch.tv/kraken/streams/'.strtolower($channelName).'?client_id='.$clientId), true); if ($json_array['stream'] != NULL) { $channelTitle = $json_array['stream']['channel']['display_name']; $streamTitle = $json_array['stream']['channel']['status']; $currentGame = $json_array['stream']['channel']['game']; $delay = $json_array['stream']['channel']['delay']; $logo = $json_array['stream']['channel']['logo']; echo "Пользователь: $channelTitle <br> Статус: $online <br> Сейчас в игре: $currentGame <br> Задержка: $delay <br> Логотип: $logo"; } else { echo "$channelName в данный момент $offline />"; }?> But here it gives an error:
Warning: file_get_contents ( https://api.twitch.tv/kraken/streams/?client_id=dreamhackcs ) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP / 1.1 400 Bad Request in V: \ home \ reg.su \ www \ index.php on line 10 РІ РґР ° РЅРЅС ‹Р№ РјРѕРјРµРС‚ Offline />