Kredns
Kredns

Reputation: 37211

How can I get started making a 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).

Upvotes: 50

Views: 47898

Answers (11)

aloisdg
aloisdg

Reputation: 23521

If you cant use System.ServiceModel.Syndication.Syndicationfeed, for example because you are using a PCL (Portable Class Library). I wrote one : FeedParserPCL. You can find it on NuGet.

Upvotes: 0

bkingdev
bkingdev

Reputation: 237

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.

Upvotes: 0

Brian
Brian

Reputation: 118865

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

Upvotes: 51

Lukas Šalkauskas
Lukas Šalkauskas

Reputation: 14361

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.

Upvotes: 1

Jafin
Jafin

Reputation: 4381

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.

Upvotes: 0

scottm
scottm

Reputation: 461

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.

Upvotes: 6

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

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

Upvotes: 0

Lee B
Lee B

Reputation: 2157

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

Upvotes: 0

dance2die
dance2die

Reputation: 36915

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

Upvotes: 11

Julien Roncaglia
Julien Roncaglia

Reputation: 17837

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

Upvotes: 0

Marco Bettiolo
Marco Bettiolo

Reputation: 5171

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

Upvotes: 0

Related Questions