File Coverage

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


line stmt bran cond sub pod time code
1             package NewsExtractor::SiteSpecificExtractor::m_news_cctv_com;
2 1     1   19 use utf8;
  1         2  
  1         7  
3 1     1   43 use Moo;
  1         3  
  1         6  
4             extends 'NewsExtractor::GenericExtractor';
5              
6 1     1   363 use Importer 'NewsExtractor::TextUtil' => qw(normalize_whitespace reformat_dateline);
  1         2  
  1         7  
7              
8             sub dateline {
9 0     0 0   my ($self) = @_;
10 0 0         my $el = $self->dom->at('span.info i') or return;
11 0           return reformat_dateline( $el->all_text(), '+08:00' );
12             }
13              
14             sub journalist {
15 0     0 0   my ($self) = @_;
16 0           my ($txt) = $self->content_text() =~ m/( (?:总台记者|编辑) (.+?))\z/xg;
17 0           $txt = normalize_whitespace($txt);
18 0           return $txt;
19             }
20              
21             1;