Skip to content

Instantly share code, notes, and snippets.

@rc1021
Created June 29, 2012 02:49
Show Gist options
  • Save rc1021/3015379 to your computer and use it in GitHub Desktop.
Save rc1021/3015379 to your computer and use it in GitHub Desktop.
get remote binary
require 'uri'
url = 'http://link.photo.pchome.com.tw/s08/emily13isme/30/134072486922/'
file = nil
open(URI.escape(url)) do |f|
file = File.open("tmp.png", "wb")
file.write(f.read) if file
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment