Text::Emoticon::Yahoo - Emoticon filter of Yahoo! Messenger
use Text::Emoticon::Yahoo; my $emoticon = Text::Emoticon::Yahoo->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/3.gif" />
Text::Emoticon::Yahoo is a text filter that replaces text emoticons like ":)", ";P", etc. to the icons of Yahoo! Messenger, detailed in http://messenger.yahoo.com/emoticons.php
$emoticon = Text::Emoticon::Yahoo->new( imgbase => "http://yourhost.example.com/images/emoticons", xhtml => 1, class => "emoticon", );
Constructs new Text::Emoticon::Yahoo object. It accepts two options:
Base URL where icon gif files are located. It defaults to "http://us.i1.yimg.com/us.yimg.com/i/mesg/emoticons6/" (the Yahoo site), but I don't recommend that, as there's a possibility Yahoo! 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::Yahoo->new(class => "emo");
will print:
<img src="blah.gif" class="emo" />
$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 (maybe Text::Emoticons)
M. Blom <b10m@perlmonk.org<gt>
Text::Emoticon::MSN by 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.yahoo.com/emoticons.php
To install Text::Emoticon::Yahoo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Text::Emoticon::Yahoo
CPAN shell
perl -MCPAN -e shell install Text::Emoticon::Yahoo
For more information on module installation, please visit the detailed CPAN module installation guide.