Skip to content

Instantly share code, notes, and snippets.

@heycarsten
Created January 7, 2009 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save heycarsten/44471 to your computer and use it in GitHub Desktop.
Save heycarsten/44471 to your computer and use it in GitHub Desktop.
require 'open-uri'
# First lets assign the results to a couple variables.
labe_output = open("http://en.wikipedia.org/wiki/Labe").read
usa_output = open("http://en.wikipedia.org/wiki/USA").read
# Okay, so if we want to just send these to stdout:
puts labe_output
puts usa_output
# We can also send them to individual files:
File.open('labe.out', 'w') { |f| f.puts(labe_output) }
File.open('usa.out', 'w') { |f| f.puts(usa_output) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment