Life & Technology

Handful lessons in different areas of technology and life in general.

Monthly Archives: May 2011

Easy RSS Syndication in .NET

My office colleague just asked me about the easy way to read and retrieve an RSS feed for a specific or multiple sites. And I say that Microsoft did indeed has a class called Syndication that resides under System.ServiceModel namespace that handles not only RSS but also Atom format too!

Below is a console application that I created to show how easy it is to read RSS via .NET:

Declare the import:

   1: using System.ServiceModel.Syndication;

Make sure you add the ServiceModel and ServiceModel.Web on your Reference.

live_writer_serviceModel

Basically, the main logic for reading RSS is to call the Url via the WebClient class and create an XmlReader object to hold/read the XML results being fetched on the WebClient request. And then, finally, just pass the XmlReader object to the Syndication object and it will parse all results into a feed collection.

live_writer_snippet01

and the Main() call would just be:

live_writer_snippet02

And when I run the project, the output will look similar on the screenshot below:

live_writer_rssConsole

Simple as that!

The RSSConsole Project File for this snippet is available for download here.

Make Your Online Presence Be Known

Just sharing you this awesome and wonderful idea online – http://about.me . Make your online profile be known for others to see.

Your Benefits:
• It’s your business card online
• No need to talk, your online profile is your portfolio
• Career highlights – good for potential employer seeking candidates
• No matter what you do professionally, you will feel at home here
• Empower your online presence
• Delight your friends, colleagues and family
• Making proud of your achievements
• Increase your network and potential clients.

So there it is, all you have to do now is go to their site and start gaining these benefits!

Start registering yourself now and make your online presence be known!