Mega Code Archive

 
Categories / Ruby / Network
 

Get a file from a URL

require 'open-uri' f = open('http://www.rubyinside.com/test.txt') puts "The document is #{f.size} bytes in length" f.each_line do |line|   puts line end