Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: User events as it happen

$
0
0
There are various events that you can use with the UserStream of Tweetinvi.
Please have a look here to learn how to use the UserStream.
var userStream = Stream.CreateUserStream();
            
userStream.TweetFavouritedByAnyoneButMe += (sender, args) =>
{
    Console.WriteLine("A tweet has been favourited by one of the person you follow!");
};

userStream.TweetCreatedByAnyoneButMe += (sender, args) =>
{
    var tweet = args.Tweet;
    var personYouFollow = tweet.Creator;

    if (tweet.IsRetweet)
    {
        Console.WriteLine(personYouFollow.Name + " you follow has retweeted the tweet : " + tweet.Text);
    }

    if (tweet.InReplyToUserId != null)
    {
        Console.WriteLine(personYouFollow.Name + " you follow has posted a tweet in reply to the person with the id : " + tweet.InReplyToUserId);
    }
};

userStream.StartStream();
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>