I’m thinking about getting into streaming and I’d like to implement pop-up notifications on stream when someone follows/hosts my channel (similar to what http://www.twitchalerts.com/ offers). I would use TwitchAlerts, but the thing is, I want a little more control over how the alerts/notifications are executed on my stream and I also don’t want to be constricted by file-size limitations.
I’m looking to make a C++ application that can execute callback algorithms when someone hosts or follows my channel.
So my questions are:
Is Twitch API what I’m looking for? Can I use it to discover new follower / host events?
2 a) Is Twitch API directly compatible with C++?
2 b) I’m reading a lot of descriptions about JavaScript and web-development. Will I have to make some kind of wrapper before I can access Twitch API with C++?
Do any such applications already exist that are freely available to the dev community?
You can use the API to request followers of a channel. There is no official API for hosts, there might be an unsupported one, but I’m not sure what it is. Alternatively you can also connect to chat with your broadcaster account and listen for messages that tell you about hosts.
To use the Twitch API you need to make HTTPS requests and parse JSON.
I’m assuming that in order to stay up-to-date with new followers, I will have to send a request on regular intervals? Will I get disconnected/ignored/blocked if I send too many requests in a short amount of time? Any idea what a safe time interval might be?
Sounds good!
I’ve never touched this stuff before. I have no problem doing research and finding my way, but I was wondering if I might get lucky:
Does anyone know of any basic (“getting started”) tutorials for making HTTPS requests using C++? Any good libraries?
Samething with JSON parsing, does anyone know of any good tutorials for use with C++? Are there any good pre-existing readers out there?
Again, thanks for your reply tduva. I can get started!
You send the request, you get the reply. The reply, as stated, is in JSON. A quick google for JSON parser in C++ leads me to: https://github.com/miloyip/rapidjson