| 1 | package NewsExtractor::SiteSpecificExtractor::yimedia_com_tw; | ||||||||||
| 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' => 'normalize_whitespace', 'u'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 0 | ▶ | before 'content_text', sub { | ||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||
| 9 | 0 | my ($self) = @_; | |||||||||
| 10 | 0 | $self->dom->find('figure.fbyt-block')->map('remove'); | |||||||||
| 11 | 0 | ▶ | if (my $el = $self->dom->at('#penci-post-entry-inner > p:last-of-type')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 12 | 0 | ▶ | if ($el->content() =~ /\A看更多<br>/) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 13 | 0 | $el->remove(); | |||||||||
| 14 | } | ||||||||||
| 15 | } | ||||||||||
| 16 | 1 | }; | |||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub journalist { | ||||||||
|
Subroutine
journalist: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 19 | 0 | my $self = $_[0]; | |||||||||
| 20 | 0 | my $ret; | |||||||||
| 21 | 0 | ▶ | if (my $el = $self->dom->at('#penci-post-entry-inner > p:nth-child(1)')) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | ▶ | if ($el->content() =~ /文字撰稿:(?<name> \p{Letter}+ )<br>/x) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 23 | 0 | ($ret) = $+{"name"}; | |||||||||
| 24 | } | ||||||||||
| 25 | |||||||||||
| 26 | } | ||||||||||
| 27 | 0 | return $ret; | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||