tags:

views:

4898

answers:

9
+7  Q: 

C# RSS Reader

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). Thanks!

+14  A: 

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 or Atom.)

Brian
See e.g. the top of http://lorgonblog.spaces.live.com/blog/cns!701679AD17B6D310!164.entry for a 10-line snippet (F#, but mostly just calling framework APIs) that will get you from Uri to printing the feed in about 30 seconds of coding.
Brian
+1  A: 

You need to work with the RSS XML specification: http://cyber.law.harvard.edu/rss/rss.html

Marco Bettiolo
A: 

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

VirtualBlackFox
+2  A: 

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

Sung Meister
A: 

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).

Lee B
A: 

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#.

Gregory A Beamer
+3  A: 

As another poster recommended, the SyndicationFeed class and Argotic are the best alternatives.

If performance is an issue, the SyndicationFeed class will be much better. I benchmarked it as being about 9 times faster than Argotic on my hardware.

The problem I've had with the SyndicationFeed class has been its ability to successfully parse any random feed from the 'net. It fails with an XmlException surprisingly often.

For my uses, I'm sticking with Argotic. After all, it is open source, so I can always make changes if I need to.

Scott
A: 

Consider reading the source code for RSS Bandit, which is a C# Winforms (possibly soon WPF) RSS Reader.

You should get some good ideas by just stepping through the application.

Jafin
A: 

I suggest you use this

RSS.NET is an open-source .NET class library for RSS feeds. It provides a reusable object model for parsing and writing RSS feeds. It is fully compatible with RSS versions 0.90, 0.91, 0.92, and 2.0.1, implementing all constructs.

Since standard syndication feed does not support other versions of rss.

Lukas Šalkauskas