Hello, i’m currently working on a site for a streamer, and when it comes to this API, I have almost no clue as to what i’m doing.
On lirik’s website - http://lirik.tv/ - He has his title updated live. Can someone explain to me how to do this? Mainly the back end part is what I need.
The API is pretty well documented here https://github.com/justintv/Twitch-API
As far as retrieving data from it, I personally prefer PHP (because that’s the only thing I know ), here is a simple example for the things you asked about:
$json = file_get_contents("https://api.twitch.tv/kraken/channels/lirik");
$api = json_decode($json, true);
echo "Stream title: ".$api['status']."<br>\n";
echo "Game: ".$api['game']."<br>\n";
echo "Followers: ".$api['followers']."<br>\n";
Ok, I prefer PHP as well thank you for this, this should help alot.
So, one more question: how would I use this? Like can you give me an html example as well?
Oh alright. Thank you guys so much
Can you give me an example of this?
You can read the jQuery documentation for examples of using their methods: http://api.jquery.com/jquery.getjson/
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.