Title / Description
Code require 'rubygems' require 'sinatra' require 'haml' require 'whois' get '/' do haml :index end # whois get '/whois' do haml :whois end post '/whois' do @host = params[:host] @results = Whois.whois(@host) haml :whois end # traceroute get '/traceroute' do haml :traceroute end post '/traceroute' do @host = params[:host] # For security reasons, remove all quote # characters from the hostname @host.gsub!(/"/,'') @results = `traceroute "#{@host}"` haml :traceroute end
Author
Highlight as C C++ CSS Clojure Delphi ERb Groovy (beta) HAML HTML JSON Java JavaScript PHP Plain text Python Ruby SQL XML YAML diff code