« NewsExtractor/SiteSpecificExtractor/news_ttv_com_tw.pm
↑ Summary
NewsExtractor/SiteSpecificExtractor/news_pts_org_tw.pm »
| 1 | package NewsExtractor::SiteSpecificExtractor::www_twreporter_org; | ||||||||||
| 2 | 1 | ▶ | use utf8; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | extends 'NewsExtractor::GenericExtractor'; | |||||||||
| 5 | |||||||||||
| 6 | 1 | ▶ | use Importer 'NewsExtractor::TextUtil' => 'u'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | sub dateline { | ||||||||
|
Subroutine
dateline: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 9 | 0 | my ($self) = @_; | |||||||||
| 10 | 0 | ▶ | my $el = $self->dom->at('meta[itemprop=dateModified][content]') or return; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | |||||||||||
| 12 | 0 | my $dateline; | |||||||||
| 13 | 0 | ▶ | if (my ($y,$m,$d) = $el->attr('content') =~ m/([0-9]{4})\.([0-9]{1,2})\.([0-9]{1,2})/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | 0 | $dateline = u(sprintf('%04d-%02d-%02d', $1, $2, $3)); | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 0 | return $dateline; | |||||||||
| 18 | } | ||||||||||
| 19 | |||||||||||
| 20 | 0 | ▶ | sub journalist { | ||||||||
|
Subroutine
journalist: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 21 | 0 | my ($self) = @_; | |||||||||
| 22 | 0 | my $txt = $self->dom->find('span[class^="metadata__AuthorName"]')->map('all_text')->uniq()->join('、'); | |||||||||
| 23 | 0 | return u($txt); | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | 1 | 1; | |||||||||