Search code examples
ruby-on-railsrssfeedatom-feed

Atom feed and rss reader


I'm trying to add a Atom feed for a page, but it just keeps spinning and adds all the items if only one new was added. What am i doing wrong?

http://legionaere.de/posts.atom?team_slug=1_team

enter image description here

I'm using the default atom_feed helper from rails3


Solution

  • I think you need to add the pubDate entry similar to the published:

    And also the format of the dates.

    for example:

    atom_feed do |feed|
      feed.title("Posts")
      feed.pubDate(CGI.rfc1123_date(@posts.first.created_at))
      feed.published(CGI.rfc1123_date(@posts.first.created_at))
      feed.updated(CGI.rfc1123_date(@posts.first.created_at))
    
      @posts.each do |post|
        feed.entry(:url => post_path(post)) do |entry|
          entry.title(post.title)
          entry.pubDate(CGI.rfc1123_date(post.created_at))
          entry.published(CGI.rfc1123_date(post.created_at))
          entry.updated(CGI.rfc1123_date(post.created_at))
        end
      end
    end