Skip to content

Instantly share code, notes, and snippets.

Created May 18, 2016 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/03a0695e838f1c8cbd12a8e17fd5aa86 to your computer and use it in GitHub Desktop.
Save anonymous/03a0695e838f1c8cbd12a8e17fd5aa86 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'rest-client'
STDOUT.sync = true
fn = "website_output.txt"
File.open(fn, "w") { |fstream|
fstream.write(RestClient.get("https://digg.com"))
}
content = File.open(fn, "r") { |fstream|
fstream.read
}
puts content
puts "\n\n\nnew read"
puts content
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment