Skip to content

Instantly share code, notes, and snippets.

@igmarin
Created Feb 9, 2013
Embed
What would you like to do?
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