smol_scriptz/crawdl.rb
christalib 39e210e064 save
2020-08-08 11:31:51 +02:00

25 lines
348 B
Ruby
Executable file

# 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