line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::TDWTF; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
20766
|
use 5.014000; |
|
1
|
|
|
|
|
4
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
39
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
892
|
use Encode qw/encode/; |
|
1
|
|
|
|
|
11201
|
|
|
1
|
|
|
|
|
78
|
|
8
|
1
|
|
|
1
|
|
768
|
use HTML::FormatText; |
|
1
|
|
|
|
|
34211
|
|
|
1
|
|
|
|
|
30
|
|
9
|
1
|
|
|
1
|
|
632
|
use WebService::TDWTF; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
330
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.001'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub print_list { |
14
|
0
|
|
|
0
|
0
|
|
my $idlen = length $_[0]->Id; |
15
|
0
|
|
|
|
|
|
for my $art (@_) { |
16
|
0
|
|
|
|
|
|
my $str = sprintf "%${idlen}d %s (by %s) in %s on %s\n", $art->Id, $art->Title, $art->AuthorName, $art->SeriesTitle, $art->DisplayDate; |
17
|
0
|
|
|
|
|
|
print encode 'UTF-8', $str; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub print_article { |
22
|
0
|
|
|
0
|
0
|
|
my ($art) = @_; |
23
|
0
|
|
|
|
|
|
printf "%s (by %s) in %s on %s\n\n", $art->Title, $art->AuthorName, $art->SeriesTitle, $art->DisplayDate; |
24
|
0
|
|
|
|
|
|
say HTML::FormatText->format_string($art->Body) |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub run { |
28
|
0
|
|
|
0
|
0
|
|
my ($args, @argv) = @_; |
29
|
0
|
0
|
|
|
|
|
return print_list tdwtf_list_recent @argv if $args->{recent}; |
30
|
0
|
0
|
|
|
|
|
return print_list tdwtf_list_series @argv if $args->{series}; |
31
|
0
|
0
|
|
|
|
|
return print_list tdwtf_list_author @argv if $args->{author}; |
32
|
0
|
|
|
|
|
|
print_article tdwtf_article @argv |
33
|
|
|
|
|
|
|
} |