public ActionResult Streams(int gameId) { TwitchApi twitch = new TwitchApi(_key); StreamsModel games = twitch.GetStreams(_clientId, gameId); StreamsViewModel gamesVm = _mapper.Map <StreamsViewModel>(games); return(View(gamesVm)); }
private async void button39_Click(object sender, EventArgs e) { if (textBox35.Text.Contains(",")) { var streams = await TwitchApi.GetStreams(textBox35.Text.Split(',').ToList()); foreach (var stream in streams) { MessageBox.Show($"{stream.Channel.Name} currently has {stream.Viewers.ToString()} viewers!"); } } else { MessageBox.Show("Seperate streams with a comma."); } }
void ITimerService.Process(double time) { if (!isconnected) { return; } followercheck -= time; if (followercheck <= 0.0) { try { CheckFollowers(); } catch (Exception e) { Logger.Error(this, "Unable to check for followers", e); } followercheck = 300.0; } viewercheck -= time; if (viewercheck <= 0.0) { if (userdata != null) { GetStreamsResponse response = twitchapi.GetStreams(userdata.ID); TwitchStream stream = response.Data.FirstOrDefault(); if (stream == null) { Logger.Warning(this, "There was no active stream found."); viewercheck = 180.0; return; } Viewers = stream.ViewerCount; viewercheck = 180.0; } } }