root/trunk/plagger/lib/Plagger/Plugin/Widget/BulkfeedsSpamReport.pm

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

New plugin Widget::BulkfeedsSpamReport?. Fixes #135

Line 
1 package Plagger::Plugin::Widget::BulkfeedsSpamReport;
2 use strict;
3 use base qw( Plagger::Plugin );
4
5 use HTML::Entities;
6 use URI;
7
8 sub register {
9     my($self, $context) = @_;
10     $context->register_hook(
11         $self,
12         'publish.entry.fixup' => \&add,
13     );
14 }
15
16 sub add {
17     my($self, $context, $args) = @_;
18     $args->{entry}->add_widget($self);
19 }
20
21 sub html {
22     my($self, $entry) = @_;
23     my $uri = URI->new('http://bulkfeeds.net/app/report_spam');
24     $uri->query_form(url => $entry->link);
25
26     my $url = HTML::Entities::encode($uri->as_string);
27     return qq(<a href="$url">Report as Splog</a>);
28 }
29
30 1;
31
32 __END__
33
34 =head1 NAME
35
36 Plagger::Plugin::Widget::BulkfeedsSpamReport - Widget to report as Splog to Bulkfeeds
37
38 =head1 SYNOPSIS
39
40   - module: Widget::BulkfeedsSpamReport
41
42 =head1 DESCRIPTION
43
44 This plugins puts a widget to report current feed (blog) as a Splog to
45 Bulkfeeds Blacklist.
46
47 =head1 AUTHOR
48
49 Tatsuhiko Miyagawa
50
51 =head1 SEE ALSO
52
53 L<Plagger>, L<http://bulkfeeds.net/app/blacklist>
54
55 =cut
Note: See TracBrowser for help on using the browser.