| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Filter::BlogPet - Filtering BlogPet
- module: Filter::BlogPet
BlogPet (http://www.blogpet.net/) is a bot program which can publish a poem like entry to the blog automatically. But those automated texts are sometimes no worth reading I think.
This plugin allows you to strip those BlogPet's entries from the feeds.
Naoya Ito <naoya@bloghackers.net>
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Filter::BlogPet; use strict; use warnings; use base qw (Plagger::Plugin); our $VERSION = '0.01'; sub register { my ($self, $context) = @_; $context->register_hook( $self, 'update.feed.fixup' => \&filter, ); } sub filter { my ($self, $context, $args) = @_; for my $entry ($args->{feed}->entries) { if ($entry->title =~ /\(BlogPet\)$/) { $context->log(info => "Delete BlogPet's entry " . $entry->link); $args->{feed}->delete_entry($entry); } } } 1; __END__