
Thanks to all those developers who take the time to build open source solutions to make all our jobs easier.
Take for instance the Linq2Twitter ( LINQ To Twitter ) open source C# library that is a LINQ provider for the Twitter API. This makes it real easy and intuitive to incorporate Twitter calls into your ASP.NET, ASP.NET MVC, Winform, and other .NET Applications.
If you are familiar with LINQ, you can use Linq2Twitter. Like the DataContext in LINQ To SQL, you have a TwitterContext in LINQ To Twitter. At a minimum you can pass in your username and password for Twitter and update your Twitter status like:
var context = new TwitterContext("[myusername]", "[mypassword]");
var status = context.UpdateStatus("Tweeted via linq2twitter");
If you wanted to grab your tweets to add to your website or application just do a little LINQ To Twitter:
var context = new TwitterContext("[myusername]", "[mypassword]");
var myTweets =
from tweet in context.Status
where tweet.Type == StatusType.User
&& tweet.ID == "[myuserid]"
&& tweet.Page == 1
&& tweet.Count == 20
select tweet;
And so on and so forth :) I am sure there are limits to the LINQ provider as it is very hard to get a LINQ Provider 100% functional, but from what I have see in the demo code it looks to be pretty functional, allowing you access account information, friends, followers, searches, direct messaging, blocking, etc.
Like I mentioned, Linq2Twitter is open source on codeplex. Get it now.
Hope this helps,
David Hayden
Tagged: .NET Developer Tools