Generate RSS/Atom feeds using FeedManager.dll

FeedManager is a custom RSS/Atom Syndication generator that allows for quick and efficient generation of RSS/Atom feeds. Just reference the dll in your web applications, then write a few lines of code to expose your data to external applications/web sites.

The rsstoolkit exists for generating syndicated feeds on the fly, but if, like me, you have had issues porting the toolkit between project types and have to keep messing with web.config settings to get it to work, then the feedmanager.dll approach might work for you. 

 Here's how to get started:

  1. Download the cutsom FeedManager.dll here.
  2. Add a reference to the dll from your solution, or simply copy the file to your application's Bin directory
  3. Open up a web page, and in the code behind, create an instance of the FeedManager.FeedCreator class
  4. Set Properties on the FeedCreator class (title, author etc)
  5. Add FeedItems to the FeedCreator class. This will typically be data obtained from a dataset.
  6. Call the GenerateFeed() Method on the FeedManager.FeedCreator class to generate your feed.
    protected void Page_Load(object sender, EventArgs e)
{
using (FeedManager.FeedCreator aFeed = new FeedManager.FeedCreator(FeedType.RSS))
{
aFeed.FeedUrl = "http://www.solid2.com";
aFeed.FeedTitle = "My RSS Feed Title";
aFeed.FeedDescription = "My RSS Feed Description";
aFeed.FeedCopyright = "(c) 2009. All rights reserved";
aFeed.FeedImage = "http://contoso/image.jpg";

//add items to the feed
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "first Item", "first summary", "Lorem ipsum dolor sit amet.", "thefirstlink", "1.aspx", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "second Item", "second summary", "Lorem ipsum dolor sit amet.", "thesecondlink", "http://www.solid2.com", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "third Item", "third summary", "Lorem ipsum dolor sit amet.", "thethirdlink", "http://www.solid2.com", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "fourth Item", "fourth summary", "Lorem ipsum dolor sit amet.", "thefourthlink", "http://www.solid2.com", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "fifth Item", "fifth summary", "Lorem ipsum dolor sit amet.", "thefifthlink", "http://www.solid2.com", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));
aFeed.AddItem(new FeedItem(Guid.NewGuid().ToString(), "sixth Item", "sixth summary", "Lorem ipsum dolor sit amet.", "thesixthlink", "http://www.solid2.com", DateTime.Now.ToString(), "Jaycent", "info@solid2.com"));

//generate the feed, send results to browser window.
aFeed.GenerateFeed();
}
}

Navigate to the page to view the ouput! 

Play around with setting the FeedType setting in the constructor between Feedtype.RSS and FeedType.Atom. View the source of the generated file to examine the difference in the output. For an excellent comparison article for ATOM vs RSS, see Aaron Brazell  article here.

 Happy new year, and happy programming!

2 Comments

  • The RSS toolkit is very useful...but it presented major headaches when you try to port it between asp.net web site and asp.net web application project types respectively. You also most often than not end up making modifications to your web.config file to get it to work.


    The FeedManager.dll works equally well regardless of the application type you select for your web app, and no configuration is required.


  • can anyone plz tell me how to implement the rss feed functionality in the asp.net web page. wt to do with the xml file which we are creating in the separate file. how to link it with the website and do it.. plz send me the solution for it

Comments have been disabled for this content.