Get Started!

Simple RSS / Atom Feed Reader

How to use the native .net classes to read RSS / Atom feeds.

.net has a built-it namespace System.ServiceModel.Syndication which enables simple RSS support.

Dependancies & References

You need to include a Reference to the System.ServiceModel.dll in your Dynamic Assembly settings.

Plus you need to make sure to import the namespace, add the following using statement to your C# :

using System.ServiceModel.Syndication;

Read the Syndicated Feed :

So you can now start to read the RSS / Atom feed:

// the location of the feed
var url = "http://gitlab.net4orce.co.uk/net4orce/canvas/commits/master.atom";    

using( var reader = XmlReader.Create(url) ){

  oFeed = SyndicationFeed.Load(reader);

  foreach (var item in oFeed.Items)  {

    // Title 
    var title = item.Title.Text;    

    // Summary
    var summary = item.Summary.Text;         

    // date
    var date = item.LastUpdatedTime;
  }   
}

That's it! You can now use title, summary etc. to present the content however you need.

See SyndicationFeed Documentation for details about the other properties.