root/lang/perl/plagger/lib/Plagger/Plugin/Filter/Gal.pm

Revision 19129, 0.8 kB (checked in by mattn, 10 months ago)

added Filter::Gal

Line 
1package Plagger::Plugin::Filter::Gal;
2use strict;
3use base qw( Plagger::Plugin );
4
5use Lingua::JA::Gal;
6
7sub register {
8    my($self, $context) = @_;
9
10    $context->register_hook(
11        $self,
12        'update.entry.fixup' => \&filter
13    );
14}
15
16sub filter {
17    my($self, $context, $args) = @_;
18
19    my $entry = $args->{entry};
20    $entry->body( Lingua::JA::Gal->gal(
21        $entry->body_text, { rate => $self->conf->{rate} || 100 }) );
22}
23
241;
25__END__
26
27=head1 NAME
28
29Plagger::Plugin::Filter::Gal -  Filter body text like Gal
30
31=head1 SYNOPSIS
32
33  - module: Filter::Gal
34    config:
35      username: your-username
36
37=head1 DESCRIPTION
38
39Filter body text like Gal using Lingua::JA::Gal
40
41=head1 CONFIG
42
43=over 4
44
45=item rate
46
47rate for converting. default is 100.
48
49=back
50
51=head1 AUTHOR
52
53Yasuhiro MATSUMOTO
54
55=head1 SEE ALSO
56
57L<Plagger>, L<Lingua::JA::Gal>
58
59=cut
Note: See TracBrowser for help on using the browser.