How can I get started making a C# RSS Reader?

Viewed 46400

I have been wanting to make a RSS reader for a while now (just for fun), but I don't have the slightest idea of where to start. I don't understand anything about RSS. Are there any good tutorials on RSS and how to implement it in an application (not a tutorial on how to make a RSS reader, that would be too easy).

11 Answers

See

http://msdn.microsoft.com/en-us/library/bb943474.aspx

http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.syndicationfeed.aspx

http://msdn.microsoft.com/en-us/library/bb943480.aspx

Basically there is a lot of stuff in the .Net 3.5 framework that does the grunt-work of parsing and representing feeds; it's not hard to write a 30-line app that takes in a feed URL and downloads the feed and prints the title and author of all the items, for example. (Works for RSS 2.0 (not others!) or Atom.)

If you are focusing on creating an RSS Reader and not on RSS parsing logic, you might want to delegate creation/reading RSS feeds using this free RSS Library called Argotic on CodePlex.com

If you write a full featured reader without using any library, also think that there are ATOM feeds to parse.

RSS itself is really simple. Just an XML description of a channel, and a list of items on that channel (possibly with files attached to each item). Keeping track of updates is a little tricky, and managing encodings and post times/dates is tricky too though. The real nightmare is all the different "interpretations" of the RSS format that different sites use. If you're really writing a feed reader, you might want to start with parsing Atom, as it's a more standardised format, and might get you further faster, with a good design to branch off into RSS from. But really, you should just use an RSS parsing library -- preferably the most compatible one available (but don't pay for an RSS library; they're common enough).

RSS is an XML dialect, so if you know XML, you have part of the problem solved. If you want a start on your project, consider looking at the open source projects already out there:

http://www.codeplex.com/site/search?projectSearchText=RSS%20Reader

CodePlex (above) is a good place to start, as the majority of the projects will be in C#.

I've been working with RSS quite a bit and have found that ATOM feeds are typically easier to parse using the RssSyndication class. For RSS 2.0 specifications, if the feed is in fact valid, then it's just as easy to load an XDocument from the URI, and parse the data as needed.

Related