root/trunk/plagger/lib/Plagger/Plugin/Filter/tDiaryComment.pm

Revision 174 (checked in by tokuhirom, 14 years ago)

add Filter::tDiaryComment

Line 
1 package Plagger::Plugin::Filter::tDiaryComment;
2 use strict;
3 use base qw( Plagger::Plugin );
4
5 our $VERSION = '0.10';
6
7 sub register {
8     my($self, $context) = @_;
9     $context->register_hook(
10         $self,
11         'update.fixup' => \&filter,
12     );
13 }
14
15 sub filter {
16     my($self, $context, $args) = @_;
17
18     for my $feed ($context->update->feeds) {
19         for my $entry ($feed->entries) {
20             $entry->add_rate($self->conf->{rate} || -1) if $entry->link =~ /#c\d+$/;
21         }
22     }
23 }
24
25 1;
26
27 __END__
28
29 =head1 NAME
30
31 Plagger::Plugin::Filter::StripRSSAd - Rating comment of tDiary.
32
33 =head1 SYNOPSIS
34
35     - module: Filter::tDiaryComment
36       config:
37             rate: -100
38
39 =head1 DESCRIPTION
40
41 This plugin rating comment of tDiary.
42
43 =head1 AUTHOR
44
45 MATSUNO Tokuhiro E<lt>tokuhiro at mobilefactory.jpE<gt>
46
47 =head1 SEE ALSO
48
49 L<Plagger>
50
51 =cut
Note: See TracBrowser for help on using the browser.