Using Rio from Ruby to easily save a Web page to file
# (sudo) gem install rio require 'rubygems' require 'rio' # open an URI an copy the content into a file rio('http://www.juretta.com/') > rio('juretta_index.html')
Cool syntax!
DZone Snippets > jswizard > web
11381 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
# (sudo) gem install rio require 'rubygems' require 'rio' # open an URI an copy the content into a file rio('http://www.juretta.com/') > rio('juretta_index.html')
require 'open-uri' require 'pp' open('http://www.juretta.com/') do |f| # hash with meta information pp f.meta # pp "Content-Type: " + f.content_type pp "last modified" + f.last_modified.to_s no = 1 # print the first three lines f.each do |line| print "#{no}: #{line}" no += 1 break if no > 4 end end