Jagira
Jagira

Reputation: 1368

How to parse random/unorganized rss feeds in Ruby/Rails?

I am facing problems while parsing RSS feeds from different sites. I need to fetch url, title and image from the feeds, but all of the sites have different structure for their feeds. Is is possible to have a generic script to fetch content from feeds of any structure?

How do browsers/feed readers/Google Reader handle this situation?

Upvotes: 0

Views: 154

Answers (1)

prodigitalson
prodigitalson

Reputation: 60413

They shouldnt have a different structure unless they are different formats (ATOM, RSS, RSS 2.0, etc..). They should all be flagged as such within the document so you need to adjust your code to take this into account... I normally use a library that abstracts all this into a single API for access the various elements. I dont really do RoR but with php i use Zend_Feed. Im sure there is something like this in the Ruby world.

Upvotes: 1

Related Questions