Im calling my feed with <%= blog_feed %>
inside the view and have a little snippet in my helper.
require 'rss/1.0'
require 'rss/2.0'
require 'open-uri'
def blog_feed
source = "http://www.domain.com/.rss" # url or local file
content = "" # raw content of rss feed will be loaded here
open(source) do |s| content = s.read end
rss = RSS::Parser.parse(content, false)
html = "<ul>"
rss.items.first(3).each do |i|
html << "<li><a href='#{i.link}'>#{i.title}</a></li>"
end
html << "</ul>"
html
end
It runs mostly the way i want. But the html is inline html. So i see li,ul and a hrefs on the website.
Any idea or suggestion?
best regards denym