Skip to content

Instantly share code, notes, and snippets.

@igmarin
Created February 9, 2013 23:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igmarin/4747586 to your computer and use it in GitHub Desktop.
Save igmarin/4747586 to your computer and use it in GitHub Desktop.
My example for Bajio on Rails Feb 9 meeting
require 'open-uri'
puts "Por favor escribe el width:"
width = gets.chomp!
puts "Por favor escribe el height:"
height = gets.chomp!
gatitos = open("http://placekitten.com/#{width}/#{height}")
archivo = File.open("gatito.jpg", "w")
gatitos.each do |l|
archivo.write(l)
end
archivo.close
exec "open gatito.jpg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment