Replace String#split processing by substring selectors

This commit is contained in:
hartator 2016-09-16 12:32:31 -05:00
parent 7b69f3c236
commit 50ee9e60be

View File

@ -78,11 +78,11 @@ class WaybackMachineDownloader
file_list_curated = Hash.new
[index_file_list_raw, all_file_list_raw].each do |file|
file.each_line do |line|
line = line.tidy_bytes.split(' ')
file_timestamp = line[0].to_i
file_url = line[1]
file_timestamp = line[0..13].to_i
file_url = line[15..-2]
file_id = file_url.split('/')[3..-1].join('/')
file_id = CGI::unescape file_id
file_id = file_id.tidy_bytes unless file_id == ""
if file_id.nil?
puts "Malformed file url, ignoring: #{file_url}"
else