views:

23

answers:

1

Hello,

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?

+1  A: 

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.

prodigitalson