15

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?

2

10 Answers 10

12

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!

6

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

3

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.

2

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.

1

Check out my library for parsing Atom feeds, (BSAtomParser) at GitHub. It doesn't care about validating the feed, it does its best at returning whatever is valid. The parser covers most of RFC 4287, even extensions.

1

Here's my solution: a really simple yet powerful RSS parsing library: https://github.com/H2CO3/RSSKit

0

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/

1
  • 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
    Feb 20, 2009 at 15:21
0

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.

0

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.