Skip to content

Instantly share code, notes, and snippets.

@rush2sk8
Created March 20, 2019 22:54
Show Gist options
  • Save rush2sk8/3060428a81139d956f47cb53681de6fe to your computer and use it in GitHub Desktop.
Save rush2sk8/3060428a81139d956f47cb53681de6fe to your computer and use it in GitHub Desktop.
require 'open-uri'
def download_image(url, dest)
open(url) do |u|
File.open(dest, "wb") { |f| f.write(u.read)}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment