3
votes

I have created an RSS parser using NSXMLParser class. The feed has an item count of 20. I would like to know how to fetch the next 20 items from the feed?

If I add the same url to google reader it fetches lot of items and keeps continuing as I scroll down. is there any particular way to fetch next 20 items from the RSS?

consider this feed of dilbert blog for example. feed://feeds.feedburner.com/typepad/ihdT?format=xml

4

4 Answers

5
votes

It's probably worth mentioning that wordpress' built in feed generator includes a pagination feature. You can use the 'paged' argument. For example:

# Most recent posts:
"http://example.com/feed/atom/"
# Next most recent posts:
"http://example.com/feed/atom/?paged=2"

I had trouble finding any wordpress documentation on this. Naturally, this is only helpful information when you're pulling from a wordpress-powered site.

3
votes

This is out of scope for the RSS standard.

Some smaller sites that generate their feeds on demand might let you parameterize the number of items by appending ?maxitems=50, and maybe even let you specify the starting position. Most of the world however rely on static feeds that can be cached and propagated and will likely never provide what you want.

Google Reader maintains their own database of items, from the first time someone subscribed to the given feed through them. They could conceivably make this available programmatically, but for now it's closed.

1
votes

The simplest solution seems to be using Google Reader's cache service and API:

http://www.google.com/reader/atom/feed/FEEDURL?n=100

Where FEEDURL is the full http path of the RSS. Most probably Google Reader stores its previous posts and with the ?n=100 argument you can specify how many blog posts you want to download.

0
votes

"feedname" is the url of the feed e.g. http://www.google.com/reader/atom/feed/http://rss.cnn.com/rss/edition.rss

Thanks Jarl for your research !