Skip to content

Instantly share code, notes, and snippets.

Created April 17, 2014 22:46
Show Gist options
  • Save anonymous/11015754 to your computer and use it in GitHub Desktop.
Save anonymous/11015754 to your computer and use it in GitHub Desktop.
#encoding: utf-8
require 'curb'
conn = Curl::Easy.new("http://wordpress.org/wordpress-3.9.zip")
conn.ssl_verify_host = false
conn.follow_location = true
conn.enable_cookies = true
file_path = File.join(Dir.pwd, 'wordpress-3.9.zip').to_s
conn.on_body { |data|
puts "Received: #{data.length} bytes"
File.open(file_path, "a") { |fh| fh.write data }
}
conn.perform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment