| 1 | # ABSTRACT: match an RSS item which has been seen before | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | |||||||||||||||
| 7 | package App::Rssfilter::Match::Duplicates; | ||||||||||||||
| 8 | 3 | $App::Rssfilter::Match::Duplicates::VERSION = '0.08'; # TRIAL | |||||||||||||
| 9 | 3 | ▶ | use Method::Signatures; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 10 | 3 | ▶ | use Try::Tiny; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 11 | 3 | ▶ | use List::MoreUtils qw< apply >; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | |||||||||||||||
| 13 | |||||||||||||||
| 14 | 3 | ▶ | func match ( $item ) { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
match: called CC=3 SCAR=11.0
Branch: 2 branches
| |||||||||||||||
| 15 | 3 | ▶ | use feature 'state'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 16 | 14 | state %prev; | |||||||||||||
| 17 | |||||||||||||||
| 18 | my @matchables = | ||||||||||||||
| 19 | 22 | ▶ | apply { s/ [?] .* \z //xms } | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 20 | 26 | grep { $_ ne '' } | |||||||||||||
| 21 | 14 | ▶ | $item->find( 'guid, link' )->map( sub { $_->text } )->each; | ||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 22 | |||||||||||||||
| 23 | 14 | my $res = grep { defined } @prev{ @matchables }; | |||||||||||||
| 24 | 14 | @prev{ @matchables } = ( 1 ) x @matchables; | |||||||||||||
| 25 | 14 | return 0 < $res; | |||||||||||||
| 26 | } | ||||||||||||||
| 27 | |||||||||||||||
| 28 | 3 | 1; | |||||||||||||
| 29 | |||||||||||||||
| 30 | __END__ | ||||||||||||||