File Coverage

blib/lib/NewsExtractor/SiteSpecificExtractor/www_twreporter_org.pm
Criterion Covered Total %
statement 9 18 50.0
branch 0 4 0.0
condition n/a
subroutine 3 5 60.0
pod 0 2 0.0
total 12 29 41.3


line stmt bran cond sub pod time code
1             use utf8;
2 1     1   8 use Moo;
  1         1  
  1         6  
3 1     1   26 extends 'NewsExtractor::GenericExtractor';
  1         2  
  1         5  
4              
5             use Importer 'NewsExtractor::TextUtil' => 'u';
6 1     1   261  
  1         2  
  1         6  
7             my ($self) = @_;
8             my $el = $self->dom->at('meta[itemprop=dateModified][content]') or return;
9 0     0 0    
10 0 0         my $dateline;
11             if (my ($y,$m,$d) = $el->attr('content') =~ m/([0-9]{4})\.([0-9]{1,2})\.([0-9]{1,2})/) {
12 0           $dateline = u(sprintf('%04d-%02d-%02d', $1, $2, $3));
13 0 0         }
14 0            
15             return $dateline;
16             }
17 0            
18             my ($self) = @_;
19             my $txt = $self->dom->find('span[class^="metadata__AuthorName"]')->map('all_text')->uniq()->join('、');
20             return u($txt);
21 0     0 0   }
22 0            
23 0           1;