May 26, 2011
Posted by on
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.
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.
and the Main() call would just be:
And when I run the project, the output will look similar on the screenshot below:
Simple as that!
The RSSConsole Project File for this snippet is available for download here.
Just sharing you this awesome and wonderful idea online – http://about.me . Make your online profile be known for others to see.
• 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!