emoji: mark yahoo additions in version 6
[sheet.git] / emoji.plp
index 2bb0b9a4bfecb698c3078c09726bdf845de3c946..73271d5892b77084508551966557a008e2d09102 100644 (file)
--- a/emoji.plp
+++ b/emoji.plp
@@ -4,31 +4,47 @@ Html({
        title => 'emoji cheat sheet',
        version => 'v1.0',
        description => [
-               "MSN emoticons",
+               "Emoticons overview and Unicode equivalents"
+               . " of MSN, Y!M, and Gmail icons.",
        ],
        keywords => [qw'
-               sheet cheat emoticon smiley emoji msn
+               sheet cheat emoticon smiley emoji unicode
+               chat im messenger msn yahoo ym gmail google
        '],
-       stylesheet => [qw'light dark red'],
+       stylesheet => [qw'light'],
 });
 
 :>
-<h1>MSN emoticons</h1>
+<h1>IM emoticons</h1>
 
 <:
-my @info = do 'emoji.inc.pl' or die $@;
-my $MSNURL = '<img src="http://messenger.msn.com/Resource/emoticons/%s.gif">';
+my %ICONURL = (
+       msn   => 'http://messenger.msn.com/Resource/emoticons/%s.gif',
+#      yahoo => 'http://l.yimg.com/us.yimg.com/i/mesg/emoticons6/%s.gif',
+       yahoo => 'http://l.yimg.com/us.yimg.com/i/mesg/emoticons7/%s.gif',
+#      yahoo-web => 'http://l.yimg.com/a/i/us/msg/emoticons/%s.gif',
+       gmail => 'http://mail.google.com/mail/help/images/screenshots/chat/%s.gif',
+);
 
-print '<table class="glyphs"><tbody>'."\n";
-for (my $i = 0; $i <= $#info; $i++) {
-       my $name = $info[$i++];
-       my ($input, $char, $desc) = @{ $info[$i] };
-       if ($char < 0) {
-               # inexact
-               $char = -$char;
+print "<ul>\n";
+
+for my $system (qw'gmail msn yahoo') {
+       my @info = do "emoji-$system.inc.pl";
+       printf '<div class="section"><h3>%s</h3>'."\n\n", $system;
+       print '<table><tbody>'."\n";
+       for (my $i = 0; $i <= $#info; $i++) {
+               my $name = $info[$i];
+               unless (ref $info[$i+1] eq 'ARRAY') {
+                       printf '</table><table><tbody>'."\n", $name;
+                       next;
+               }
+               my ($input, $attr, $char, $desc) = @{ $info[++$i] };
+               printf('<tr><th><img src="'.$ICONURL{$system}.'"><td><kbd>%s</kbd><td>%s%s'."\n",
+                       $name, EscapeHTML($input), $desc // $name, $char ? '<td>'.chr($char) : '',
+               );
        }
-       printf "<tr><th>%s<td><kbd>%s</kbd><td>$MSNURL<td>%s\n",
-               $name, EscapeHTML($input), $desc, chr($char);
+       print "</table></div>\n\n";
 }
-print "</table>\n";
+
+print "</ul><hr>\n\n";