16

I have an RSS feed that I follow and would like to display it on my website. The UI would simply contain the description of the article in the RSS feed and also have the link to click on.

Since I'm using the ASP.NET C# framework, I'm wondering if this has been done before.

Thanks!

locoboy
  • 38,002
  • 70
  • 184
  • 260

1 Answers1

23

The consumption (and generation) of feeds has been baked into the framework since .NET 3.5 SP1 in the System.ServiceModel.Syndication namespace.

You can consume a feed (ATOM or RSS) using the SyndicationFeed class, like this:

var reader = XmlReader.Create("http://localhost/feeds/serializedFeed.xml");
var feed = SyndicationFeed.Load(reader);

Lots of examples on MSDN - take a look at the namespace page I've linked to. Should get you started.

Matt Hamilton
  • 200,371
  • 61
  • 386
  • 320