Text::Emoticon::MSN - Emoticon filter of MSN Messenger
use Text::Emoticon::MSN; my $emoticon = Text::Emoticon::MSN->new( imgbase => "http://example.com/emo", ); my $text = "Yet Another Perl Hacker ;-)"; print $emoticon->filter($text); # it prints # Yet Another Perl Hacker <img src="http://example.com/emo/regular_smile.gif" />
Text::Emoticon::MSN is a text filter that replaces text emoticons like ":-)", ";-P", etc. to the icons of MSN Messenger, detailed in http://messenger.msn.com/Resource/Emoticons.aspx
$emoticon = Text::Emoticon::MSN->new( imgbase => "http://yourhost.example.com/images/emoticons", xhtml => 1, class => "emoticon", );
Constructs new Text::Emoticon::MSN object. It accepts two options:
Base URL where icon gif files are located. It defaults to "http://messenger.msn.com/Resource/emoticons" (the MSN site) but I don't recommend that, as there's a possibility MSN will ban your site.
Whether it uses XHTML style img tags. It defaults to 1.
CSS class used in img tags. It defaults to nothing.
img
$emoticon = Text::Emoticon::MSN->new(class => "emo");
will print:
<img src="blah.gif" class="emo" />
Whether it will disable smileys with space in them. defaults to 0.
$filtered_text = $emoticon->filter($text);
Filters emoticons in text and returns img tagged text (HTML).
Handling original emoticons. (Patches welcome)
Common API for other Emoticons like Yahoo! (maybe Text::Emoticons)
Tatsuhiko Miyagawa <miyagawa@bulknews.net>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
http://messenger.msn.com/Resource/Emoticons.aspx
To install Text::Emoticon::MSN, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Emoticon::MSN
CPAN shell
perl -MCPAN -e shell install Text::Emoticon::MSN
For more information on module installation, please visit the detailed CPAN module installation guide.