#!/usr/bin/env ruby def htmlContents(page) %Q{Content-Type: text/html Content-Length: #{page.length} #{page} } end def now Time.now.strftime("%d.%m.%Y") end def fortune %x{/usr/bin/fortune} end def fortunePage %Q{ The Message of the Day The message of the day (#{now}) is:
#{fortune}
} end $stdout.print(htmlContents(fortunePage))