File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/news_tnn_tw.pm
Criterion Covered Total %
statement 9 16 56.2
branch n/a
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 12 23 52.1


line stmt bran cond sub pod time code
1             package NewsExtractor::SiteSpecificExtractor::news_tnn_tw;
2 1     1   8 use utf8;
  1         2  
  1         8  
3 1     1   37 use Moo;
  1         3  
  1         7  
4             extends 'NewsExtractor::GenericExtractor';
5              
6 1     1   348 use Importer 'NewsExtractor::TextUtil' => 'reformat_dateline';
  1         3  
  1         9  
7              
8             sub dateline {
9 0     0 0   my ($self) = @_;
10 0           my $el = $self->dom->at("span.f12_15a_g2");
11 0           return reformat_dateline( $el->text(), '+08:00' );
12             }
13              
14             sub journalist {
15 0     0 0   my ($self) = @_;
16 0           my $txt = $self->content_text;
17              
18 0           my ($x) = $txt =~ m{[〔﹝【]記者 \s* ([ \p{Letter}]+?) \s* (?:[//]\p{Letter}+)?報導[﹞〕】]}x;
19 0           return $x;
20             }
21              
22             1;