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


Share

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

Kick It on DotNetKicks.com
blog comments powered by Disqus