Created
January 28, 2024 20:44
-
-
Save phillipoertel/7cc82b98502085510670fd65d708b613 to your computer and use it in GitHub Desktop.
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
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