line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Data::Timeline::IScrobbler; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
35
|
|
5
|
1
|
|
|
1
|
|
1963
|
use DateTime::Format::DateParse; |
|
1
|
|
|
|
|
267486
|
|
|
1
|
|
|
|
|
15
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
67
|
use base qw(Data::Timeline::Builder); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
901
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
__PACKAGE__->mk_scalar_accessors(qw(log_filename)); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
use constant DEFAULTS => ( |
19
|
|
|
|
|
|
|
log_filename => "$ENV{HOME}/Library/Logs/iScrobbler.log", |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub create { |
24
|
|
|
|
|
|
|
my $self = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $timeline = $self->make_timeline; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
my $filename = $self->log_filename; |
29
|
|
|
|
|
|
|
open my $fh, '<', $filename or die "can't open $filename: $!\n"; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
while (<$fh>) { |
32
|
|
|
|
|
|
|
next unless /^\[(.*?)\]-\[VERB\] Added '(.*)'/; |
33
|
|
|
|
|
|
|
$timeline->entries_push($self->make_entry( |
34
|
|
|
|
|
|
|
timestamp => DateTime::Format::DateParse->parse_datetime($1), |
35
|
|
|
|
|
|
|
description => $2, |
36
|
|
|
|
|
|
|
type => 'iscrobbler', |
37
|
|
|
|
|
|
|
)); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
close $fh or die "can't close $filename: $!\n"; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
$timeline; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
1; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
__END__ |