Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best way to parse RSS/Atom feeds for an iPhone application?

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?

like image 739
jpm Avatar asked Feb 19 '09 16:02

jpm


People also ask

What is better Atom or RSS?

RSS and Atom are the two main standards of web syndication. Atom was developed to avoid the limitations and flaws of RSS. Though Atom is more robust than RSS, the latter still remains a widely used standard.

How do you use Atom feeds?

To "subscribe" to a site feed, whether RSS or ATOM, you need a feed reader. Simply point the reader to the URL (address) of the site feed, and it will do the rest: it will display the contents of the feed in a window or panel for you. The feed will look like a series of messages.


2 Answers

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!

like image 167
Michael Waterfall Avatar answered Oct 08 '22 10:10

Michael Waterfall


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

like image 40
slf Avatar answered Oct 08 '22 12:10

slf