|
Revision 372
(checked in by naoya, 3 years ago)
|
added Filter::BlogPet?
|
| Line | |
|---|
| 1 |
package Plagger::Plugin::Filter::BlogPet; |
|---|
| 2 |
use strict; |
|---|
| 3 |
use warnings; |
|---|
| 4 |
use base qw (Plagger::Plugin); |
|---|
| 5 |
|
|---|
| 6 |
our $VERSION = '0.01'; |
|---|
| 7 |
|
|---|
| 8 |
sub register { |
|---|
| 9 |
my ($self, $context) = @_; |
|---|
| 10 |
$context->register_hook( |
|---|
| 11 |
$self, |
|---|
| 12 |
'update.feed.fixup' => \&filter, |
|---|
| 13 |
); |
|---|
| 14 |
} |
|---|
| 15 |
|
|---|
| 16 |
sub filter { |
|---|
| 17 |
my ($self, $context, $args) = @_; |
|---|
| 18 |
for my $entry ($args->{feed}->entries) { |
|---|
| 19 |
if ($entry->title =~ /\(BlogPet\)$/) { |
|---|
| 20 |
$context->log(info => "Delete BlogPet's entry " . $entry->link); |
|---|
| 21 |
$args->{feed}->delete_entry($entry); |
|---|
| 22 |
} |
|---|
| 23 |
} |
|---|
| 24 |
} |
|---|
| 25 |
|
|---|
| 26 |
1; |
|---|
| 27 |
|
|---|
| 28 |
__END__ |
|---|
| 29 |
|
|---|
| 30 |
=head1 NAME |
|---|
| 31 |
|
|---|
| 32 |
Plagger::Plugin::Filter::BlogPet - Filtering BlogPet |
|---|
| 33 |
|
|---|
| 34 |
=head1 SYNOPSIS |
|---|
| 35 |
|
|---|
| 36 |
- module: Filter::BlogPet |
|---|
| 37 |
|
|---|
| 38 |
=head1 DESCRIPTION |
|---|
| 39 |
|
|---|
| 40 |
BlogPet (L<http://www.blogpet.net/>) is a bot program which can publish a |
|---|
| 41 |
poem like entry to the blog automatically. But those automated texts are |
|---|
| 42 |
sometimes no worth reading I think. |
|---|
| 43 |
|
|---|
| 44 |
This plugin allows you to strip those BlogPet's entries from the feeds. |
|---|
| 45 |
|
|---|
| 46 |
=head1 AUTHOR |
|---|
| 47 |
|
|---|
| 48 |
Naoya Ito E<lt>naoya@bloghackers.netE<gt> |
|---|
| 49 |
|
|---|
| 50 |
=head1 SEE ALSO |
|---|
| 51 |
|
|---|
| 52 |
L<Plagger> |
|---|
| 53 |
|
|---|
| 54 |
=cut |
|---|