Twitter exposes a really nice API. I thought wouldn’t it be fun if you could display a rolling list of messages that have been posted to you.
I figured this would be really useful for public events, live shows etc. Stick with me :-)
So to prove the concept, I thought lets implement this in the Compact Framework so that it would be easy to run on a CE machine. connected to our JumboTron display.
Cutting to the chase, if you want a download of the application in its entirety you can install it on your Windows Mobile device by clicking -
Here’s the source to go pull out any Twitter posts to a given user.
public static XmlDocument GetStatus(string username, string password)
{
XmlDocument retdoc = new XmlDocument();
try
{
string user = Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(username + ":" + password));
HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://twitter.com/statuses/replies.xml");
request.Method = "POST";
request.Headers.Add("Authorization", "Basic " + user);
request.ContentType = "application/x-www-form-urlencoded";
WebResponse res = request.GetResponse();
retdoc.Load(res.GetResponseStream());
res.Close();
}
catch
{
}
return retdoc;
}
Full source of the project here -
Let me know what you think, or better still send me a twitter update @richard_jones