All pastes #604698 Raw Edit

kane77

public ruby v1 · immutable
·published 2007-07-05 18:52 UTC
rendered paste body
require 'rss/2.0'require 'open-uri'class FeedController < ApplicationController  def index    feed_url = 'http://kane.faster.sk/feed'    output = "<h1>My RSS Reader</h1>"     open(feed_url) do |http|      response = http.read      result = RSS::Parser.parse(response, false)      @favicon=result.channel.image      output += "Feed Title: #{result.channel.title}<br />"       result.items.each_with_index do |item, i|        output += "#{i+1}. #{item.title}<br /> "       end      end    render_text output     endend