Skip to content

Instantly share code, notes, and snippets.

@ryanlecompte
Created April 5, 2011 18:42
Show Gist options
  • Save ryanlecompte/904220 to your computer and use it in GitHub Desktop.
Save ryanlecompte/904220 to your computer and use it in GitHub Desktop.
simple image retriever example
require 'open-uri'
url = 'http://www.hobotraveler.com/uploaded_images/207-249-tiger-nut-efio-togo-food-798405.jpg'
f = File.open('image.jpg', 'w')
open(url) { |io| f.puts(io.read) }
f.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment