smol_scriptz/crawdl.rb

26 lines
348 B
Ruby
Raw Permalink Normal View History

2018-11-04 22:14:49 +01:00
# 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