line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#$Id: HasAnyFeeds.pm,v 1.1 2005/11/14 03:39:09 naoya Exp $ |
2
|
|
|
|
|
|
|
package Acme::Web20::Validator::Rule::HasAnyFeeds; |
3
|
2
|
|
|
2
|
|
5311
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
73
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
87
|
|
5
|
2
|
|
|
2
|
|
9
|
use base qw (Acme::Web20::Validator::Rule); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
210
|
|
6
|
2
|
|
|
2
|
|
1677
|
use Feed::Find; |
|
2
|
|
|
|
|
11315
|
|
|
2
|
|
|
|
|
230
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
__PACKAGE__->name('Syndicate with RSS or Atom feeds?'); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub validate { |
11
|
1
|
|
|
1
|
0
|
3
|
my ($self, $res) = @_; |
12
|
1
|
|
|
|
|
13
|
my $html = $res->content; |
13
|
1
|
|
|
|
|
25
|
my @feeds = Feed::Find->find_in_html(\$html, $res->base); |
14
|
1
|
|
|
|
|
5083
|
$self->is_ok(scalar @feeds); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
1; |