| 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 | { | ||||||||||||||
| 9 | 3 | $App::Rssfilter::Match::Duplicates::VERSION = '0.07'; | |||||||||||||
| 10 | } | ||||||||||||||
| 11 | 3 | ▶ | use Method::Signatures; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 12 | 3 | ▶ | use Try::Tiny; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 13 | |||||||||||||||
| 14 | |||||||||||||||
| 15 | 3 | ▶ | func match ( $item ) { | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
match: called CC=3 SCAR=12.0
Branch: 2 branches
| |||||||||||||||
| 16 | 3 | ▶ | use feature 'state'; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 17 | 4 | state %prev; | |||||||||||||
| 18 | |||||||||||||||
| 19 | my @matchables = | ||||||||||||||
| 20 | 0 | map { s/ [?] .* \z //xms; $_ } | |||||||||||||
| 21 | 0 | grep { $_ ne '' } | |||||||||||||
| 22 | $item->find( 'guid, link' )->pluck( 'text' )->each; | ||||||||||||||
| 23 | |||||||||||||||
| 24 | 0 | my $res = grep { defined } @prev{ @matchables }; | |||||||||||||
| 25 | 0 | @prev{ @matchables } = ( 1 ) x @matchables; | |||||||||||||
| 26 | 0 | return 0 < $res; | |||||||||||||
| 27 | } | ||||||||||||||
| 28 | |||||||||||||||
| 29 | 3 | 1; | |||||||||||||
| 30 | |||||||||||||||
| 31 | __END__ | ||||||||||||||