Created
May 27, 2024 22:53
-
-
Save rwhitworth/018748422f8b55c18f8c835ccfdac64c to your computer and use it in GitHub Desktop.
eve online killboard - how active per hour
This file contains hidden or 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
# download daily tarballs from https://data.everef.net/killmails/ | |
# tar xjf kill*.tar.bz2 | |
# this will extract files into killmails sub-directory | |
require 'json' | |
require 'time' | |
search_corp = '1354830081' # condi | |
search_corp = '1727758877' # ncdot | |
max_bar_length = 30; | |
file_listing = Dir.glob('killmails/*.json'); | |
a = file_listing.collect{|x| JSON.parse(File.read(x)) }; | |
b = a.select{|x| x['victim']['alliance_id'].to_s == search_corp.to_s}.collect{|x| {'time'=>x['killmail_time'], 'corporation_id'=>x['victim']['corporation_id']} }; | |
c = b.collect{|x| Time.parse(x['time']).hour }.group_by{|x| x}.map{|k,v| [k, v.length]}.to_h; | |
# 100 / biggest item in list | |
modifier = 100.0/c.collect{|x| x[1]}.sort.last | |
d = c.sort.to_a.collect {|x| (x[1] * modifier).to_i / (100 / max_bar_length)}; | |
c.sort.each{|x| puts "#{x[0]}\t" + 'x' * d[x[0]].to_i}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment