hacks/mtgox.tradescraper/dailyprice.pl
Jeffrey Paul 847ad2ac80 mtgox trade history data from bitcoin talk
also removed unnecessary other directories from backup script, added desktop to
exclude list (rationale: ~/Desktop is roughly as important as ~/tmp, which is
excluded)
2011-08-23 00:24:08 +02:00

30 lines
517 B
Perl
Executable File

#!/usr/bin/perl
use warnings qw( all );
use strict;
use DateTime;
use Data::Dumper;
main();
sub main {
my $days;
while(<>) {
chomp;
my @parts = split(/\,/);
my $dt = DateTime->from_epoch( epoch => $parts[0] );
$dt = dt2ymd($dt);
print STDERR "setting $dt to " . $parts[1] . "\n";
$days->{$dt} = $parts[1] + 0;
}
foreach (sort(keys(%$days))) {
print "$_," . $days->{$_} . "\n";
}
}
sub dt2ymd {
my $dt = shift;
return $dt->ymd('-');
}