Ruby
Retrieve Page Contents via Http Get
Posted August 16th, 2007 by administrator
This script retrieves the content of url and dumps it to the output
Example copy this script into file named : get_page.rb
#!/usr/bin/ruby
require 'net/http'
host,port,url = ARGV
http = Net::HTTP.new(host, port)
STDERR.puts "url {#url}"
response, data = http.get(url)
puts data
Usage
ruby get_page.rb <host> <port> <url>
The url is specified as a relative path