File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/hk_crntt_com.pm
Criterion Covered Total %
statement 9 13 69.2
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 20 60.0


line stmt bran cond sub pod time code
1             package NewsExtractor::SiteSpecificExtractor::hk_crntt_com;
2 1     1   7 use utf8;
  1         3  
  1         6  
3 1     1   35 use Moo;
  1         2  
  1         6  
4             extends 'NewsExtractor::GenericExtractor';
5              
6 1     1   370 use Importer 'NewsExtractor::TextUtil' => qw(u normalize_whitespace);
  1         2  
  1         7  
7              
8             sub dateline {
9 0     0 0   my ($self) = @_;
10 0 0         my $el = $self->dom->at('td[align=center] > font[style="font-size:14px"]') or return;
11              
12 0           my @t = split /[^0-9]+/, normalize_whitespace($el->parent->text);
13 0           return u( sprintf('%04d-%02d-%02dT%02d:%02d:%02d+08:00', $t[0], $t[1], $t[2], $t[3], $t[4], $t[5]) );
14             }
15              
16             1;