Search code examples
ruby-on-railsrssaggregationfeedatom-feed

Aggregating feeds in Rails application


I am thinking of writing a daemon to loop through feeds and then add them into the database as ActiveRecord objects.

Firstly, one problem I am facing is that I cannot reliably retrieve the author/user of a story using the feed-normalizer gem. It appears that some times, it does not recognize the tag (I don't know if anyone else has faced this problem).

Secondly, I haven't seen anyone convert RSS feeds back into database entries. I need to do this as each entry will have associations with other ActiveRecord objects. I can't find any gems to do this specifically, but could I somehow hack something like acts_as_feed to do that?


Solution

  • Don't use SimpleRSS. It won't decode HTML entities for you, and it occasionally ignores the structure of the feed.

    I've found it easiest to parse the feed as XML with XMLSimple, but you can use any XML parser.