Created
April 12, 2017 01:20
-
-
Save gusanthiago/b04cc02de8548d50292d467c881803ad to your computer and use it in GitHub Desktop.
Requisita uma imagem de um dominio e salva
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 'net/http' | |
port = 8080 | |
Net::HTTP.start("domain", port) do |http| | |
resp = http.get("/img/cam.jpg") | |
open("file_name.jpg", "wb") do |file| | |
file.write(resp.body) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment