Twitch Desktop app for watching streams

I created a software for livestreams that allowes you to watch streams with vlc and mpchc.
i tried to add an option to check if a streamer is broadcasting, but i didnt find one,
does anybody have any idea how to check if a user is currently broadcasting in C#?

i finished my app and it works great but if i could add that it would be perfect.

The API you will want to use for this is: https://github.com/justintv/Twitch-API/blob/master/v2_resources/streams.md#get-streamschannel

if the stream key is null, the channel is offline. If it is not then the channel is live.

2 Likes

here try this out

string sUsername = "NAME HERE";

string sUrl = "https://api.twitch.tv/kraken/streams/" + sUsername;
HttpWebRequest wRequest = (HttpWebRequest)HttpWebRequest.Create(sUrl);
wRequest.ContentType = "application/json";
wRequest.Accept = "application/vnd.twitchtv.v3+json";
wRequest.Method = "GET";

dynamic wResponse = wRequest.GetResponse().GetResponseStream();
StreamReader reader = new StreamReader(wResponse);
dynamic res = reader.ReadToEnd();
reader.Close();
wResponse.Close();

if (res.Contains("display_name")) {
    //user is live

} else {
    //user is not live

}
1 Like

Thanks a lot it worked great.

your welcome glad it worked

is there any way i can make a chat window in c#?
does the chat has any API for c#, or maybe a way to open a popup window directly to the chat.
when i tried to open the chat in a popup window it always says there is a problem to connect and it leaves me with an empty chat window.
you got any idea how can i get the chat to my software?
btw this is what i have so far if you want to see it:

https://drive.google.com/file/d/0B8vffvvZgMr7ck9wUk42MElCdWs/view?usp=sharing

There is no easy way to get chat embedded in your app. I have chat in my app but its taking me over 2 mouths trying stuff to get it to work. You can make a browser open with chat in it. But its not embed. Use this code.

string sUsername = "USERNAME HERE";

string sUrl = "http://www.twitch.tv/" + sUsername + "/chat";
Process.Start(sUrl);

You app is coming alone good.
You can read here Twitch chat wont load in webbrowser control vb.net to see what I used. More info here https://www.google.com/#q=geckofx%20c%23 Or get someone to add it or give you all the code and files you will need for it but that kinda stuff aint free.

I think i will just give up on that chat thing.
thanks a lot for the help appreciate it.

yeah its been a pain getting chat to work in my app. and your welcome.

This app works perfectly for me (instead of in-browser twitch which stops after ~30 seconds), but could you please add “High” quality? Currently there are only “Source” (which is called “High” within app), “Medium” and “Low”.
Thanks in advance!
P.S. I do a programming a bit, so if you could provide me sources so maybe I could do it on my own.

You can check Twichist: https://github.com/kursion/twichist

You can use IRC for the chat, I’ve done it before