We moved our Athlo blog to a WordPress app to separate it completely from the main app. One interaction I wanted between the two though was for the most recent blog entries to show on the Athlo site. I thought that RSS would offer an easy solution so I started looking around to find out if I’d need a Rails plugin or something like that.
The solution was far simpler. And pure Ruby (man I love this language!).
require 'rss' rss = RSS::Parser.parse(open('http://blog.athlo.com/feed/').read, false).items[0..MaxRSSItems-1]
That’s it. That simple call supplies you with a full array of all the items from the RSS feed. In my specific example, I’ve used a range to limit the results to the value of MaxRSSItems.
No plugins required. No Rails required. Ruby RSS will do what you need to read feeds. (That should be in a poem.)