I’ve embedded two twitch streams on my site. I also have two buttons, which allow my users to switch from one stream to the other. Eventually, I’d like to have several buttons with several different streamers to choose from. But I would like to add a text element for each stream that changes from “offline” to “online” depending on whether or not the streamer is live. Each streamer will have a text element near their button showing their streaming status.
I think I can figure out the if/then coding, but is there a way to “query” or “get” or otherwise “test” the status on twitch? Here’s what I found online for getting a streamer’s live status:
GET https://api.twitch.tv/kraken/streams/
I found this link here:
https://dev.twitch.tv/docs/v5/reference/streams/#get-stream-by-user
Can anyone get me started in the right direction?