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

Revision 397 (checked in by miyagawa, 15 years ago)

New Plugin: Filter::FeedFlareStripper?

  • Property svn:keywords set to Id Revision
Line 
1 package Plagger::Plugin::Filter::FeedFlareStripper;
2 use strict;
3 use base qw( Plagger::Plugin );
4
5 sub register {
6     my($self, $context) = @_;
7     $context->register_hook(
8         $self,
9         'update.entry.fixup' => \&filter,
10     );
11 }
12
13 sub filter {
14     my($self, $context, $args) = @_;
15
16     my $body = $args->{entry}->body;
17     if ($body =~ s!<div class="feedflare">.*?</div>!!) {
18         $context->log(info => "Stripped FeedFlare on " . $args->{entry}->link);
19         $args->{entry}->body($body);
20     }
21 }
22
23 1;
24
25 __END__
26
27 =head1 NAME
28
29 Plagger::Plugin::Filter::FeedFlareStripper - Strip FeedFlare from feeds
30
31 =head1 SYNOPSIS
32
33   - module: Filter::FeedFlareStripper
34
35 =head1 DESCRIPTION
36
37 This plugin strips FeedBurner's FeedFlare widget from feed content.
38
39 =head1 AUTHOR
40
41 Tatsuhiko Miyagawa
42
43 =head1 SEE ALSO
44
45 L<Plagger>, L<http://www.feedburner.com/>
46
47 =cut
Note: See TracBrowser for help on using the browser.