NAME

Text::Emoticon::Yahoo - Emoticon filter of Yahoo! Messenger

SYNOPSIS

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" />

DESCRIPTION

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

METHODS

new
$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:

imgbase

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.

xhtml

Whether it uses XHTML style img tags. It defaults to 1.

class

CSS class used in img tags. It defaults to nothing.

$emoticon = Text::Emoticon::Yahoo->new(class => "emo");

will print:

<img src="blah.gif" class="emo" />
filter
$filtered_text = $emoticon->filter($text);

Filters emoticons in text and returns img tagged text (HTML).

TODO

  • Handling original emoticons. (Patches welcome)

  • Common API for other Emoticons (maybe Text::Emoticons)

AUTHOR

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.

SEE ALSO

http://messenger.yahoo.com/emoticons.php