File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/www_idn_com_tw.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::www_idn_com_tw;
2 1     1   8 use utf8;
  1         3  
  1         8  
3 1     1   33 use Moo;
  1         3  
  1         7  
4             extends 'NewsExtractor::GenericExtractor';
5              
6 1     1   368 use Importer 'NewsExtractor::TextUtil' => qw< reformat_dateline >;
  1         2  
  1         7  
7              
8             sub dateline {
9 0     0 0   my ($self) = @_;
10 0           my $text = $self->content_text;
11 0           my ($ymd) = $text =~ m{ ( [0-9]{4}/[0-9]{1,2}/[0-9]{1,2} ) [\))]?\z}x;
12 0 0         return $ymd ? reformat_dateline( $ymd, '+08:00' ) : undef;
13             }
14              
15             1;