Skip to content

Instantly share code, notes, and snippets.

@phillipoertel
Created January 28, 2024 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phillipoertel/7cc82b98502085510670fd65d708b613 to your computer and use it in GitHub Desktop.
Save phillipoertel/7cc82b98502085510670fd65d708b613 to your computer and use it in GitHub Desktop.
require 'open-uri'
`mkdir files`
URL = 'https://www.cia.gov/library/abbottabad-compound/index_video.html'
html = URI.open(URL).read
files = html.scan(/"\.(.*Jerry.*\.rm(vb)?)">/i)
urls = files.map { |a| URL.gsub('/index_video.html', a.first) }
urls.each do |u|
filename = 'Tom' + u.split('_Tom').last
path = "./files/#{filename}"
cmd = "curl #{u} -o #{path}"
puts cmd
`#{cmd}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment