Created
August 14, 2012 07:33
-
-
Save Krizzzn/3347237 to your computer and use it in GitHub Desktop.
Ruby - download file over http
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' | |
Net::HTTP.start("website.com") do |http| | |
resp = http.get("/episode_archive/s#{season}ep#{episode}.mp3") | |
open("s#{season}ep#{episode}.mp3", "w") 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