require 'net/http'
require 'uri'
require 'open-uri'
class Page
def initialize(url)
@url = url
@uri = URI.parse(url)
@response = Net::HTTP.get_response(@uri)
@body = @response.body
end
def title
puts "\nTitle(s):"
title = /<title>(.*)<\/title>/.match(@body.to_s)
p title[1]
end
end