Twitter feeds are provided in RSS XML format. This makes it very easy for us to parse out the information we want from a feed using LINQ to XML. For example, if we want to grab the message and date of each Twitter entry, we could use something like this:
public class Twitter
{
public string Message { get; set; }
public DateTime PubDate { get; set; }
public static List<Twitter> Parse(string User)
{
var rv = new List<Twitter>();
var url = "http://twitter.com/statuses/user_timeline/" + User + ".rss";
var element = XElement.Load(url);
foreach (var node in element.Element("channel").Elements("item"))
{
var twit = new Twitter();
var message = node.Element("description").Value;
twit.Message = message.Replace(User + ": ", string.Empty);
twit.PubDate = DateTime.Parse(node.Element("pubDate").Value);
rv.Add(twit);
}
return rv;
}
}
You can get the Twitter feeds by using the following:
var fromTwitter = Twitter.Parse("Merlin981");

merlin981
|
Software Developer (Senior)
|
|
United States
|
Winner - Best Mobile App - AT&T Developer Summit, Las Vegas, 2013
My personal resume can be found at: http://www.philippiercedeveloper.com
My game portfolio can be found at: http://www.rocketgamesmobile.com
About Philip Pierce:
I am a software developer with twenty years experience in game development, mobile, web, desktop, server, and database. My extensive background highlights an expertise in rapid application development using the latest Microsoft, Mobile, and Game Development technologies, along with the ability to create AI for games and business software, redesign existing software, develop multi-threaded software, and create client/server applications.