Skip to content

Instantly share code, notes, and snippets.

@kopylovvlad
Created October 12, 2018 18:52
Show Gist options
  • Save kopylovvlad/4d76e0b4f40ade786c84430d806b9b4a to your computer and use it in GitHub Desktop.
Save kopylovvlad/4d76e0b4f40ade786c84430d806b9b4a to your computer and use it in GitHub Desktop.
require 'open-uri'
urls = [
'https://www.google.com/',
'https://www.youtube.com/',
'http://www.rubyflow.com',
'https://rubyonrails.org/'
]
urls.each do |url|
resp = open(url)
puts "#{url} has content length #{resp.read.size} symbols"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment