Hello, world!

Your IP is: 34.204.180.1

Your USER AGENT is: CCBot/2.0 (https://commoncrawl.org/faq/)

The source code for this program is:


#!/opt/bin/ruby

require 'cgi'

cgi = CGI.new("html4Tr")

remote_ip = ENV["REMOTE_ADDR"]
user_agent = ENV["HTTP_USER_AGENT"]

cgi.out {
  cgi.div("align"=>"center") { 
    cgi.h1 { "Hello, world!" } +
    cgi.h2 { "Your IP is: #{remote_ip}" } +
    cgi.h2 { "Your USER AGENT is: #{user_agent}" }
  } +
  cgi.h2 { "The source code for this program is:" } +
  cgi.hr +
  cgi.pre { File.read(__FILE__) }
}