Created
February 9, 2013 23:33
-
-
Save igmarin/4747586 to your computer and use it in GitHub Desktop.
My example for Bajio on Rails Feb 9 meeting
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' | |
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