Limiting items in RSS Feeds
Posted in Article, Tips, Tutorial on October 8th, 2010 by Ian Ford – Be the first to commentToday I was working on reorganizing the journal section of my portfolio. The problem that I’ve run into is that the entire journal ends up being dominated by items from individual feeds rather than an interesting mix.
The reason for this is obvious: I listen to dozens of songs everyday, but only write so many blog posts, tweet so many times, and bookmark so many pages. As a result, when I first debuted the site, a coworker innocently complimented me on the “playlist” section of the site.
The solution, in my mind, is to break the content up from a single list into smaller lists, each with a limited number of items on display. Since the content will now be limited, the data I download should be limited as well. My RSS feeds should be limited by the number of items I actually expect to display (in this case, about 5 per feed).
What I’m here to tell you today is that while limiting RSS feeds is as easy as appending a query string to the end of your feed url, the actual parameter used varies from feeed to feed. Here are my discoveries:
- Delicious and Twitter feeds can be limited by using the count parameter in your query string.
- Last.FM can be limited by using the limit parameter in your query string.
- WordPress can supposedly be limited by using amount (or at least Safari seems to think so…), but I wasn’t able to get the feed to behave differently using either that or either of the alternatives above. The only way I was able to change the number of items in my wordpress feed was via my admin panel.
Why the inconsistency? Who the hell knows. What do you prefer? Personally I feel most comfortable with limit as it reminds me of what I would use in other areas (SQL).
