Introducing tweet#, the complete fluent C# library for Twitter

tweet# is a complete C# library for Twitter that allows you to write short and sweet expressions that are automatically converted to Twitter queries and sent on your behalf. In addition to covering 100% of Twitter’s REST and Search APIs, tweet# also provides the following configurable features:

  • Discoverable method chains that only expose what you can actually call
  • Hooks for easy asynchronous operation
  • Status update truncation by word, and automated URL shortening
  • Server-side caching of queries (ASP.NET, memcached, or use your own)
  • Quick and painless conversion from JSON query results to C# data classes

Here are just a few examples to show you what’s possible with tweet#:

// Get the public timeline, caching the result for two minutes
var twitter = FluentTwitter.CreateRequest()
     .Configuration.CacheUntil(2.Minutes().FromNow())
     .Statuses().OnPublicTimeline().AsJson();

// Send a blocking call
var response = twitter.Request();

// Convert response to data classes
var statuses = response.AsStatuses();

With plans to support OAuth, selectors, rate limiting, and geocoding enhancements, tweet# should accelerate your Twitter client development.

// Send a status update with automatic URL shortening
var twitter = FluentTwitter.CreateRequest()
     .Configuration.UseUrlShortening()
     .AuthenticateAs(username, password)
     .Statuses().Update("http://code.google.com/p/tweetsharp")
     .CallbackTo((s, e) =>
                     {
                          // do stuff asynchronously...
                          var updated = e.Response.AsStatus();
                     }.AsXml();

// Send an asynchronous call
twitter.RequestAsync();

Feedback on design, features, and issues is greatly appreciated. The best way to get acquainted with tweet# syntax and style, currently, is to download the code or browse the unit tests.

I hope you find it useful!

Project code is hosted by Google Code:
http://code.google.com/p/tweetsharp

tweet# uses James Newton-King’s JSON.NET, the Enyim Memcached Client, and would like to thank Sean Erickson for his assistance with multi-part form posts.

kick it on DotNetKicks.com

Sharing
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Identi.ca
  • TwitThis

Tweetbacks

  1. @balexandre I am experimenting with the tweet# #csharpTwitter API wrapper. http://tinyurl.com/8ow6oz

  2. @johnsheehan If you just need to display tweets, I recommend search.twitter.com. Also, you may want to look at tweet# http://bit.ly/aY16

  3. Introducing tweet#, the complete fluent C# library for Twitter http://tinyurl.com/8ow6oz

  4. @leggetter The fluent interface of tweet# seems promising. http://is.gd/fpbS

  5. Introducing tweet#, the complete fluent C# library for Twitter | dimebrain http://tinyurl.com/8ow6oz

  6. @seavista The fluent interface of tweet# seems promising. http://is.gd/fpbS #dotnet #csharp