-
-
Save anteaya/44474 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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