Created
November 12, 2015 23:49
-
-
Save tbodt/998f44f5595b7c8f7e5c to your computer and use it in GitHub Desktop.
codebreaker
This file contains 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
#!/usr/bin/env ruby | |
require 'net/http' | |
ep_num = ARGV[0].to_i | |
0.upto 999 do |i| | |
num = i.to_s.rjust(3, "0") | |
url = URI("http://download.publicradio.org/podcast/marketplace/codebreaker/2015/11/11/codebreaker_#{ep_num}_20151111_#{num}_64.mp3") | |
res = Net::HTTP.get_response(url) | |
if res.code.to_i != 404 | |
print "\rFOUND! #{url}\n" | |
exit | |
else | |
print "\r#{num}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment