Twitch API Checking if a Channel is Live
<p>I found a way to check if a channel is live on Twitch. I have been getting a error, "Trying to get property of non-object" for the "return ( ! is_null( $Request->stream ) ) ? TRUE : FALSE;" line. Everything seems set. I would appreciate any suggestions/help.</p>

<pre><code>    &lt;?php
function is_channel_live( $channel ) {
    $Request = json_decode( @file_get_contents( 'https://api.twitch.tv/kraken/streams/' . $channel ) );
    return ( ! is_null( $Request-&gt;stream ) ) ? TRUE : FALSE;
}

if (is_channel_live("thegamingbelugas")) {
    echo "LIVE";
}

?&gt;
</code></pre>