Exemple #1
0
        public void OnNext(StreamingMessage value)
        {
            TweetReceived?.Invoke(value.Json);

            // to avoid streaming too much data (try streaming tweets related to Trump lol)
            Thread.Sleep(_interval);
        }
Exemple #2
0
 private void OnMatchingTweetReceived(object sender, Tweetinvi.Events.MatchedTweetReceivedEventArgs e)
 {
     logger.LogInformation($"OnMatchingTweetReceived Twitter message received. {JsonConvert.SerializeObject(e)}");
     if (e.Tweet.CreatedBy.Id == _botUser.Id)
     {
         logger.LogInformation("Skip. Tweet is created by bot.");
         return;
     }
     TweetReceived?.Invoke(this, e);
 }
Exemple #3
0
 private void OnMatchingTweetReceived(object sender, Tweetinvi.Events.MatchedTweetReceivedEventArgs e)
 {
     Debug.WriteLine("OnMatchingTweetReceived Twitter message received");
     Debug.WriteLine(JsonConvert.SerializeObject(e));
     if (e.Tweet.CreatedBy.Id == _botUser.Id)
     {
         Debug.WriteLine("Skip. Tweet is created by bot.");
         return;
     }
     TweetReceived?.Invoke(this, e);
 }
 private void OnMessageReceived(object sender, Tweetinvi.Events.MessageEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("Twitter message received");
     TweetReceived?.Invoke(this, e);
 }