Twitch Desktop app for watching streams

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