This is a mirror of official site: http://jasper-net.blogspot.com/

Reading RSS and Atom Syndication Feeds

| Sunday, July 3, 2011
RSS and Atom feeds provide a standardised means of providing syndicated content via the Internet. The feeds publish XML documents that can be downloaded by web sites that aggregate stories from several places or into feed reader software.


Syndication Feeds

   Syndication feeds, also known as news feeds or web feeds, are often created by content providers to publish information about the latest articles or stories on a web site. The publisher provides the feed as a downloadable document in a standardised format. Consumers of the feed are usually feed readers or automated processes. A feed reader is a software application that downloads feeds and presents them in a readable format with links to the original story. Automated software may aggregate related stories from multiple feeds and present them via a web site or portal.

Two standards for news feeds are Really Simple Syndication (RSS) and Atom Syndication Format. Both standard use XML to define various elements of the feed and the stories contained within. However, the two formats are quite different. Each has different XML elements for the same information and some data in one format is not present in the other. This can lead to problems if you are writing software that aggregates feeds of both standards. These problems can be overcome with the use of the SyndicationFeed class.


SyndicationFeed Class

   The SyndicationFeed class is used to represent an RSS or Atom feed using the same set of properties. It contains properties for all of the key information read from a feed or required to create feed XML. The class is found in the System.ServiceModel.Web.dll assembly when using the .NET framework version 3.5 and in System.ServiceModel.dll for .NET 4.0. For both framework versions, the class is defined in the System.ServiceModel.Syndication namespace. To follow the sample code, add a reference to the required DLL and add the following using directive:


using System.ServiceModel.Syndication;


Downloading a Feed

   To download the data from a feed, we can use an XmlTextReader object. This class is found in the System.Xml namespace:

using System.Xml;

Read more: Black Wasp
QR: RSSAtomFeed.aspx

Posted via email from Jasper-net

0 comments: