Home > Uncategorized > Favourite Tweets using C# Tweetsharp

Favourite Tweets using C# Tweetsharp

If you want to make noise on twitter, favouriting people’s tweets does draw a little attention, so I decided to try to do this automatically, to see if I could build followers.- Here is the code I used in C# (authentication details removed) – you need a reference to TweetSharp

var service = new TwitterService(“########”, “######”);
service.AuthenticateWith(“###”, “#####”);
TwitterSearchResult res = service.Search(new SearchOptions { Q = args[0], Count = 100});
IEnumerable<TwitterStatus> status = res.Statuses;
foreach (var tweet in status)
{
Console.WriteLine(tweet.Text);
service.FavoriteTweet(new FavoriteTweetOptions{Id = tweet.Id});
}

It takes a command line argument, which it uses as a search term, so you can favourite tweets that are relevant.

And, hey if you want to follow me, please go to: https://twitter.com/webtropy

Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment