feat(remove): remove top monthly visits, add forgotten new line

Signed-off-by: Miguel Nogueira <me@nogueira.codes>
This commit is contained in:
Miguel Nogueira 2024-05-20 09:52:17 +01:00
parent e49e90f91e
commit 4703e28e32
Signed by: miguel456
GPG Key ID: 43EF15DB0CC86DDD
1 changed files with 1 additions and 9 deletions

10
main.rb
View File

@ -150,18 +150,10 @@ top_client_errors.each do |ip, count|
puts "#{ip}: #{count} errors" puts "#{ip}: #{count} errors"
end end
top_monthly_visits = monthly_visits.sort_by { |_ip, dates| -dates.values.sum }.first(5)
top_monthly_visits.each do |ip, dates|
puts "IP #{ip} had the most visits in the following months:"
dates.each do |date, count|
puts " #{date}: #{count} visits"
end
end
monthly_visits.each do |ip, visits| monthly_visits.each do |ip, visits|
puts "IP #{ip} had the following visits:" puts "IP #{ip} had the following visits:"
visits.each do |date, count| visits.each do |date, count|
puts " #{date}: #{count} visits" puts " #{date}: #{count} visits"
end end
end end