Beispiel #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            TwitterFeedDriver tfd = new TwitterFeedDriver();

            tfd.StartStreaming();
            tfd.StopStream.IsEnabled = true;
            tfd.StreamData.IsEnabled = false;
        }
Beispiel #2
0
        public Tuple <float, float, int, float> avgTweetsPerSecond(float elapsedTime, int tweetAmount, DataModel dm, TwitterFeedDriver tfd)
        {
            loopSeconds = tfd.StreamTime / 1000;
            float tweet = 0;

            dm.totalTweet += tweetAmount;
            tweet          = tweetAmount / loopSeconds;
            oneSec         = 0;
            for (int a = 0; a < loopSeconds; a++)
            {
                secList.Add(tweet);
            }
            tweet = 0;
            foreach (float b in secList)
            {
                tweet += b;
            }
            if (secList.Count == sixty)
            {
                oneMin = calcMinHour("minute");
                sixty += 60;
            }
            if (secList.Count == threeK)
            {
                oneHour = calcMinHour("hour");
                threeK += 3600;
            }
            oneSec = float.Parse(Math.Round((tweet / secList.Count), 2).ToString());
            return(new Tuple <float, float, int, float>(oneSec, oneMin, runningMinutes, oneHour));
        }