| Plagger documentation | Contained in the Plagger distribution. |
Plagger::Plugin::Filter::Emoticon - Emoticon Filter
- module: Filter::Emoticon
config:
driver: Yahoo
option:
strict: 1
xhtml: 0
This filter replaces text emoticons like ":-)", ";-P" etc. with Text::Emoticon.
Specify the driver's name of Text::Emoticon you want to use. It defaults to 'MSN'. 'Yahoo' and 'GoogleTalk' are also available.
Specify the options you want to pass to the Text::Emoticon.
Naoya Ito <naoya@bloghackers.net>
| Plagger documentation | Contained in the Plagger distribution. |
package Plagger::Plugin::Filter::Emoticon; use strict; use warnings; use base qw( Plagger::Plugin ); our $VERSION = 0.01; use Text::Emoticon; sub register { my($self, $context) = @_; $context->register_hook( $self, 'update.entry.fixup' => \&filter, ); } sub filter { my($self, $context, $args) = @_; my $entry = $args->{entry}; my $emoticon = Text::Emoticon->new( $self->conf->{driver} || 'MSN', $self->conf->{option} || {}, ); $entry->body($emoticon->filter($entry->body)); } 1; __END__