Skip to content

Instantly share code, notes, and snippets.

@mgalgs
Created June 7, 2012 05:08
Show Gist options
  • Save mgalgs/2886707 to your computer and use it in GitHub Desktop.
Save mgalgs/2886707 to your computer and use it in GitHub Desktop.
$ pry
[1] pry(main)> require 'net/http'
=> true
[2] pry(main)> u = URI('http://www.archive.org/download/MIT_Structure_of_Computer_Programs_1986/lec4a.mp4')
=> #<URI::HTTP:0x9aa793c URL:http://www.archive.org/download/MIT_Structure_of_Computer_Programs_1986/lec4a.mp4>
[3] pry(main)> res = Net::HTTP.get_response(u)
=> #<Net::HTTPFound 302 Moved Temporarily readbody=true>
[4] pry(main)> res['location']
=> "http://archive.org/download/MIT_Structure_of_Computer_Programs_1986/lec4a.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment