Home > Programming > Implement an RSS reader into your .NET program.

Implement an RSS reader into your .NET program.

December 6th, 2009 Jimmy Leave a comment Go to comments

If you’re looking for RSS support in your .NET application head over to RSSdotnet.com and download the latest RSS.NET library. They provide all the source code and API documents you need to add RSS into your program. I haven’t thoroughly reviewed the code but it does work pretty code and seems stable. I’m currently using it in a blog tool I am about to release but more on that later lets see some RSS.NET code!

Below is a very simple implementation on how you can use RSS.NET. Don’t forget to add the project to your solution and add a reference to that project! This should parse out my RSS feed and pause for each item.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rss;
namespace ConsoleRssTest
{
    class Program
    {
        static void Main(string[] args)
        {
            RssFeed feed = RssFeed.Read("http://feeds.feedburner.com/uniprogrammer");
            RssChannel channel = (RssChannel)feed.Channels[0];
            foreach (RssItem Ri in channel.Items)
            {
                Console.WriteLine(Ri.Title);
                Console.WriteLine(Ri.Link.AbsoluteUri);
                Console.WriteLine(Ri.Description);

                //This will let you read each feed as they come in....
                Console.WriteLine("Press any key too continue...");
                Console.ReadLine();

            }

        }
    }
}

Categories: Programming Tags: , , ,
Digg: DIGG ME
  1. No comments yet.
  1. No trackbacks yet.