TweetSharp is a complete .NET library for microblogging platforms that allows you to write short and sweet expressions that convert automatically to web queries and fly to Twitter on your behalf. We strive to cover 100% of the Twitter API and actively keep up with enhancements and changes from Twitter itself. TweetSharp was developed by Daniel Crenna and Jason Diller.

25 March 2009 ~ Comments

How to retrieve public timeline statuses

In this example, we use three namespaces. The first, Dimebrain.TweetSharp.Fluent is the root namespace and allows you to build requests for Twitter, and handle their responses which come in the form of a string in JSON, XML, RSS, or Atom format. If that’s all you need, then you’re good to go.

Dimebrain.TweetSharp.Extensions lets you use convenience methods to turn responses you receive from Twitter into data classes, so that you can bind them to UI, persist them in a database, or even convert them back into their original formats. In this example, the public timeline is polled for new statuses, and the result string response is converted into TwitterStatus objects, classes you can use in your client applications.

This example also hints at a Configuration expression that allows you to cache responses you make to Twitter. This is helpful if you want to limit the traffic from your application to Twitter if you are polling the API at low intervals. You can configure a cache to use ASP.NET Web Cache, a simple dictionary, or build your own cache implementation to plug in and use, by implementing the IClientCache or IWebCache interfaces.

In this example, all queries made for the resource describe are cached locally for two minutes before expiring, causing the next request to reach Twitter for its data.

Tags: ,

21 March 2009 ~ Comments

Hello, TweetSharp!

TweetSharp is a complete .NET library for microblogging platforms that allows you to write short and sweet expressions that convert automatically to web queries and fly to Twitter on your behalf. In addition to covering 100% of Twitter’s REST and Search APIs, TweetSharp also provides the following configurable features, with many more undocumented or in development:

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

TweetSharp is actively developed by Dimebrain, licensed under the MIT License, and the source code is hosted on Google Code.

Keep an eye on this blog for release news, articles, snippets, and screencasts to help you get the most out of TweetSharp.