1: Register your app to obtain a client ID and client secret
2: Paste your Client ID and Client Secret into the config.ini file into the according keys
3: Download the package, extract it and copy the files into the folder of your website / webapp (where the websites main index.php file is located).
If you want, use the provided "example/index.php" to learn how to use this tool first, before implementing it into your website!
- if you want to add the livestream status on the mainpage, it often is the "index.php". Extract the files where the "index.php" is.
- if you have a page like "/streamers", go to the folder for the streamers php files and extract the files here.
If you want, you can also create a new folder (but keep in mind that you then have to change the require path).
After that, you only need to insert these three lines into your PHP File (in most cases "index.php") to get it running:
require('twitch_status_tool.php'); // change path if you created a folder
$yourChannelName = new StreamerStatus("YourChannelName");
$yourChannelNameStatus = $yourChannelName->returnLiveStatus(); // result: "online" or "offline"
- Change the require Path if you created a folder.
- Change "YourChannelName" to the Twitch Channelname for which you want to get the current online / offline status.