require 'sinatra'
require 'open-uri'

get '/' do
  @result = open("http://whatthecommit.com/index.txt").read
  erb :index
end

__END__

@@ index
<!DOCTYPE html>
<html>
  <head>
    <title>Your commit message</title>
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/zclip/1.1.2/jquery.zclip.min.js"></script>
    <script src="http://hedtek.com/jquery.zclip.html5.js"></script>
  </head>
  <body>
    <p id="commit-message"><%= @result %></p>
    <a href=""><i class='fa fa-refresh'></i></a>
    | 
    <a href="#" data-clipboard data-clipboard-target="#commit-message"><i class='fa fa-copy'></i></a>
  </body>
</html>