176b339d1c9594b733ae043047c04b7f47070dd8
[sheet.git] / emoji.plp
1 <(common.inc.plp)><:
2
3 Html({
4         title => 'emoji cheat sheet',
5         version => 'v1.0',
6         description => [
7                 "MSN emoticons",
8         ],
9         keywords => [qw'
10                 sheet cheat emoticon smiley emoji msn
11         '],
12         stylesheet => [qw'light dark red'],
13 });
14
15 :>
16 <h1>IM emoticons</h1>
17
18 <:
19 my %ICONURL = (
20         msn   => 'http://messenger.msn.com/Resource/emoticons/%s.gif',
21         yahoo => 'http://l.yimg.com/us.yimg.com/i/mesg/emoticons7/%s.gif',
22 #       yahoo-web => 'http://l.yimg.com/a/i/us/msg/emoticons/%s.gif',
23 );
24
25 print "<ul>\n";
26
27 for my $system (qw'msn yahoo') {
28         my @info = do "emoji-$system.inc.pl";
29         printf '<div class="section"><h3>%s</h3>'."\n\n", $system;
30         print '<table><tbody>'."\n";
31         for (my $i = 0; $i <= $#info; $i++) {
32                 my $name = $info[$i];
33                 unless (ref $info[$i+1] eq 'ARRAY') {
34                         printf '</table><table><tbody>'."\n", $name;
35                         next;
36                 }
37                 my ($input, $attr, $char, $desc) = @{ $info[++$i] };
38                 printf('<tr><th><img src="'.$ICONURL{$system}.'"><td><kbd>%s</kbd><td>%s%s'."\n",
39                         $name, EscapeHTML($input), $desc // $name, $char ? '<td>'.chr($char) : '',
40                 );
41         }
42         print "</table></div>\n\n";
43 }
44
45 print "</ul><hr>\n\n";
46