From 0cc7a1e703cd6097c82f41f5385f33cbd0cfcb5a Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 15 May 2015 20:30:18 +0200 Subject: make the feed items nicer. --- lib/rss2html/feed.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/rss2html/feed.rb') diff --git a/lib/rss2html/feed.rb b/lib/rss2html/feed.rb index 909b08c..28d395c 100644 --- a/lib/rss2html/feed.rb +++ b/lib/rss2html/feed.rb @@ -17,6 +17,7 @@ require 'rss' require 'open-uri' require 'erb' +require 'date' module Rss2Html class Feed @@ -59,5 +60,13 @@ module Rss2Html view_path = File.join(File.dirname(__FILE__), 'views') ERB.new(IO.read(File.join(view_path, t))) end + + def pretty_date(d) + d.to_date + end + + def pretty_url(u) + u.hostname.gsub(/www\./, '') + end end end -- cgit v1.2.3