Skip to content

Instantly share code, notes, and snippets.

@tbodt
Created November 12, 2015 23:49
Show Gist options
  • Save tbodt/998f44f5595b7c8f7e5c to your computer and use it in GitHub Desktop.
Save tbodt/998f44f5595b7c8f7e5c to your computer and use it in GitHub Desktop.
codebreaker
#!/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