Skip to content

Instantly share code, notes, and snippets.

@rwhitworth
Created May 27, 2024 22:53
Show Gist options
  • Save rwhitworth/018748422f8b55c18f8c835ccfdac64c to your computer and use it in GitHub Desktop.
Save rwhitworth/018748422f8b55c18f8c835ccfdac64c to your computer and use it in GitHub Desktop.
eve online killboard - how active per hour
# 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