Simple Online/Offline Script Help Needed

You’re not sending a Client-ID, which is required to use the API. https://blog.twitch.tv/client-id-required-for-kraken-api-calls-afbb8e95f843#.ws4h7qtyp

I wouldn’t recommend using file_get_contents and instead use cURL. There are many threads here on the forum showing how to use cURL and how to detect if someone is online/offline.