Skip to content

Instantly share code, notes, and snippets.

@a0s
Created October 8, 2015 09:33
Show Gist options
  • Save a0s/488a55568545882aad68 to your computer and use it in GitHub Desktop.
Save a0s/488a55568545882aad68 to your computer and use it in GitHub Desktop.
VK chat stats by person
pp File.read('dump.txt').
scan(/class="mem_link"\starget="_blank">([^<]+)/m).
flatten.
inject(Hash.new(0)) { |total, e| total[e] += 1 ;total}.
map{|k,v| [v, k] }.
sort{|a, b| a[0] <=> b[0] }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment