Amplify’s TwitterN, Yet Another C# Twitter REST API Library
http://code.google.com/p/twittern
I put together a C# twitter library that uses WCF’s DataContract & DataMembers and .Net 3.5’s DataContractJsonSerializer. Its currently in alpha stage, as I need to finish writing the tests, documentation and make a simple WPF client for twitter. I needed a twitter library for a personal "secret" project of mine and found that most twitter libraries do not keep up with the twitter API and break when using them. Plus they tend to go to great lengths when parsing the xml. Unfortunately I do not know if this will work on mono yet. It seems that they have "Olive", which is mono’s version of WCF and I’ve seen where they have a path for the "DataContractJsonSerializer". If there are any one familiar enough with mono, please by all means use the code, join the project.
One design decision that I made was to use Json rather than xml as its more compact and less data to transfer. I used WCF because with DataContract & DataMembers you can parse Json and you can name your properties the property way with Pascal Case properties and then tell wcf what attributes of json they represent. This way you don’t have properties that look like ruby like "screen_name" or "profile_sidebar_border_color" in your Data Transfer Object in order to deserialize the Json response from twitter.
A basic sample of how to use the library is below.
using Amplify.Twitter;
using System.Security;
// ... stuff
public void Test()
{
SecureString password = new SecureString();
string temp = "password";
for (var i = 0; i < temp.Length; i++)
password.AppendChar(temp[i]);
password.MakeReadOnly();
Twitter.SetCredentials("Username", password);
StatusService service = Twitter.CreateStatusService();
// or StatusService service = new StatusService("Username", password);
List<Status> tweets = service.GetUserTimeline("MichaelHerndon");
}