You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
smol_scriptz/crawdl.rb

25 lines
348 B

# frozen_string_literal: true
require 'socket'
require 'OpenURI'
puts 'What host?'
host = gets.chomp
host.to_s
puts 'What port?'
port = gets.chomp
port.to_i
puts 'Path?'
path = gets.chomp
path.to_s
open(host) do |f|
f.each_line { |line| p line }
p f.base_uri
p f.content_type
p f.charset
p f.content_encoding
p f.last_modified
end