line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
use utf8; |
2
|
1
|
|
|
1
|
|
8
|
use Moo; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
6
|
|
3
|
1
|
|
|
1
|
|
25
|
extends 'NewsExtractor::GenericExtractor'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
3
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Importer 'NewsExtractor::TextUtil' => qw(u); |
6
|
1
|
|
|
1
|
|
268
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
7
|
|
|
|
|
|
|
my ($self) = @_; |
8
|
|
|
|
|
|
|
|
9
|
0
|
|
|
0
|
0
|
|
# Example: <div class="updatetime">07/10/2020 10:59 PM</div> |
10
|
|
|
|
|
|
|
my $dateline = $self->dom->at('div.updatetime')->all_text; |
11
|
|
|
|
|
|
|
my @t = $dateline =~ m/([0-9]+)/g; |
12
|
0
|
|
|
|
|
|
$t[3] += 12 if $dateline =~ /PM\z/; |
13
|
0
|
|
|
|
|
|
|
14
|
0
|
0
|
|
|
|
|
return u(sprintf( |
15
|
|
|
|
|
|
|
'%04d-%02d-%02dT%02d:%02d:%02d+08:00', |
16
|
0
|
|
|
|
|
|
$t[2], # year |
17
|
|
|
|
|
|
|
$t[0], # month |
18
|
|
|
|
|
|
|
$t[1], # mday |
19
|
|
|
|
|
|
|
$t[3], # hour |
20
|
|
|
|
|
|
|
$t[4], # minute |
21
|
|
|
|
|
|
|
59, # sec |
22
|
|
|
|
|
|
|
)); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
my ($self) = @_; |
26
|
|
|
|
|
|
|
my $el = $self->dom->at('div.author > p') or return; |
27
|
|
|
|
|
|
|
return $el->all_text =~ s/\s*\(By\s+(.+)\)\s*/$1/r; |
28
|
0
|
|
|
0
|
0
|
|
} |
29
|
0
|
0
|
|
|
|
|
|
30
|
0
|
|
|
|
|
|
1; |