Created
October 27, 2009 12:03
-
-
Save jkramer/219517 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Chart::Pie; | |
use IO::File; | |
my $pie = Chart::Pie->new(640, 480); | |
my $score; | |
my $io = new IO::File($ENV{HISTFILE}); | |
for($io->getlines) { | |
/^:\s*\d*:\d*;(\w+)/ or next; | |
++$score->{$1}; | |
} | |
my $top = { | |
map { $_ => $score->{$_} } | |
(sort { $score->{$b} <=> $score->{$a} } keys %$score)[0 .. 9] | |
}; | |
$pie->add_dataset(keys %$top); | |
$pie->add_dataset(values %$top); | |
$pie->png("history.png"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment