FeedLib.NET

This is the future home of the FeedLib.NET library. FeedLib.NET is the library used by FeedJumbler as a generic layer on top of Atom.NET and RSS.NET.

The current version can be downloaded here (as a compiled Assembly): FeedLib.zip. The source will be available later. Note that in order to use FeedLib.NET, you will need to download both Atom.NET and RSS.NET as well.

Usage

Here's a C# example how to use FeedLib.NET. This FeedProcessor class could be used as an utility class that is called from an ASP.NET page or similar. It will retrieve the feeds that are specified in the urls array and output them as a new merged feed to the response stream.

using System;
using System.Web;
using Lazytom.FeedLib;

namespace FeedProcessor
{
	public class FeedProcessor
	{
		public static void MergeFeeds( string[] urls, string title, string resultUrl  )
		{
			Feed resultFeed = new Feed();

			// retrieve the feeds
			Feed[] feeds = FeedReader.RetrieveFeeds( urls );

			// concatenate the feeds
			foreach( Feed feed in feeds )
			{
				resultFeed.Append( feed );
			}

			// now sort items
			resultFeed.SortItems();

			// create new output feed
			resultFeed.Url = resultUrl;
			resultFeed.Title = title;
			
			HttpContext.Current.Response.ContentType = "application/rss+xml";
			RssFeedWriter writer = new RssFeedWriter( resultFeed );

			writer.WriteToStream( HttpContext.Current.Response.OutputStream );

		}
	}
}

© 2005 by Marcel Marchon - created and designed by lazytom.