views:

4219

answers:

8

So I understand that there are a few options available as far as parsing straight XML goes: NSXMLParser, TouchXML from TouchCode, etc. That's all fine, and seems to work fine for me.

The real problem here is that there are dozens of small variations in RSS feeds (and Atom feeds too), so supporting all possible permutations of feeds available out on the Internet gets very difficult to manage. I searched around for a library that would handle all of these low-level details for me, but came out without anything.

Since one could link to an external C/C++ library in Objective-C, I was wondering if there is a library out there that would be best suited for this task? Someone must have already created something like this, it's just difficult to find the "right" option from the thousands of results in Google.

Anyway, what's the best way to parse RSS/Atom feeds in an iPhone application?

A: 

Have you looked at TouchCode yet? I don't think it has an RSS processor, but it might give you a start. http://code.google.com/p/touchcode/

Steven Fisher
I mentioned Touchcode on my question, but like I said, I want a RSS/Atom feed framework/library, so I can avoid doing all of the logic of dealing with different versions of RSS/RDF/Atom/etc myself.
jpm
A: 

I came accross igasus project on sourceforge today. I haven't used it or really checked it, but perhaps it might help.

From their site: igagus is a web service for the iPhone that allows aggregation of RSS to be delivered in an iPhone friendly format.

Koray Balci
A: 

Actually, I was trying to suggest you ask on the TouchCode discussion board, because I remember someone was trying to expand it to support RSS. That might be a decent starting point. But I was being rushed by my wife.

But I see now that TouchCode doesn't have a discussion board. I'd still ask the author, though, he might know what came of that effort.

Steven Fisher
+2  A: 

take a look at apple's XML Performance sample -- which points to using libXML directly -- for performance and quicker updates to the display. Which may be important if you are working with very large feeds.

+4  A: 

"Best" is relative. The best performance you'll need to go the SAX route and implement the handlers. I don't know of anything out there open source available (start a google code project and release it for the rest of us to use!)

Whatever you do, it's probably a really bad idea to try and load the whole XML file into memory and act on it like a DOM. Chances are you'll get feeds that are much larger than you can handle on the device leading to frequent memory warnings and crashes.

slf
A: 

This might be a reasonable starting point for you. Atom support isn't there yet, but you could help out?

jabley
+2  A: 

I've just released an open source RSS/Atom Parser for iPhone and hopefully it might be of some use.

I'd love to hear your thoughts on it too!

Michael Waterfall
A: 

I'm currently trying out the MWFeedParser @Michael Waterfall is developing.

Quite easy to set up and use (I'm a beginner iPhone developer).

His sample code for using MWFeedParser to populate a UITableViewController implementation is helpful as well.

Matt Moore