Atom and Syndication

I wanted to write a program to read tweets.  There are easy to use REST based API to give you JSON or ATOM feed. There are many ways to read XML, using XMLReader, XML Serialization etc. However, I was not knowing how easy it is to read any atom feed using the syndication API of .NET.  So here it is …

using System;
using System.Linq;
using System.Xml;
using System.ServiceModel.Syndication;

namespace ReadTwitter
class Program
static void Main(string[] args)
XmlReader reader = XmlReader.Create(@;
SyndicationFeed feed = SyndicationFeed.Load(reader);
var tweetItems = from item in feed.Items
            select new
foreach (var o in tweetItems)
Console.WriteLine(o.Text );

Here is another alternative for windows phone, as we don’t have SyndicationFeed object yet in windows phone.

WebClient wc = new WebClient();
XmlReader reader = XmlReader.Create ( wc.OpenRead(@""));
while (reader.Read())
if (reader.NodeType == XmlNodeType.Element)
if (reader.Name == "content")

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s