Ejemplo n.º 1
0
 private async void button12_Click(object sender, EventArgs e)
 {
     if (await TwitchApi.BroadcasterOnline(textBox13.Text))
     {
         MessageBox.Show(String.Format("'{0}' is ONLINE!", textBox13.Text));
     }
     else
     {
         MessageBox.Show(string.Format("'{0}' is OFFLINE!", textBox13.Text));
     }
 }
Ejemplo n.º 2
0
        private async void DashboardRefreshTimer_Tick(object sender, EventArgs e)
        {
            //MessageBox.Show(
            //delay, uptime, averagefps, broadcaster language filter, broadcaste check box

            StreamGame.Text  = (await TwitchApi.GetTwitchChannel(channel)).Game;
            StreamTitle.Text = (await TwitchApi.GetTwitchChannel(channel)).Status;
            string langCode = (await TwitchApi.GetTwitchChannel(channel)).BroadcasterLanguage;

            StreamLanguage.SelectedValue = langCode;
            if (await TwitchApi.BroadcasterOnline(channel) != false)
            {
                StreamViewers.Text = (await TwitchApi.GetTwitchStream(channel)).Viewers.ToString();
            }
            else
            {
                StreamViewers.Text = "Stream Offline";
            }
            StreamFollowers.Text = (await TwitchApi.GetTwitchChannel(channel)).Followers.ToString();
        }
Ejemplo n.º 3
0
        private void TwitchCheck(object state)
        {
            Printer.PrintTag("TwitchCheck", "Checking for online streams.");
            var previousStreams = new List <string>(Lists.OnlineStreams);

            Lists.OnlineStreams.Clear();
            try
            {
                foreach (var stream in Lists.TwitchStreams)
                {
                    if (TwitchApi.BroadcasterOnline(stream).Result)
                    {
                        Lists.OnlineStreams.Add(stream);
                    }
                }
                foreach (var stream in Lists.OnlineStreams)
                {
                    if (previousStreams.Count == 0)
                    {
                        Printer.PrintTag("TwitchCheck", stream + " is online!");
                        Channels.TwitchChannel.SendMessage(stream + " is now online, playing " + TwitchApi.GetTwitchChannel(stream).Result.Game + "! http://www.twitch.tv/" + stream);
                    }
                    else
                    {
                        if (!previousStreams.Contains(stream))
                        {
                            Printer.PrintTag("TwitchCheck", stream + " is online!");
                            Channels.TwitchChannel.SendMessage(stream + " is now online, playing " + TwitchApi.GetTwitchChannel(stream).Result.Game + "! " + TwitchApi.GetTwitchChannel(stream).Result.Status + " http://www.twitch.tv/" + stream);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Printer.PrintTag("Exception", ex.Message);
            }
        }