1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
require 'rubygems' 
require 'sinatra'

get '/' do
  erb :home
end

use_in_file_templates! 

__END__ 

@@ home

<h1>Shortener</h1>

<p> 
Shortener makes your long URLs shorter. 
No longer will you have to worry about 
sending people links that get messed up by IM or email!
</p>

<form action="/shorten" method="post" accept-charset="utf-8">
  <input type="text" name="url" value="Paste a URL..." id="url">

  <input type="submit" value="..and shorten it!">
</form>