2014-07-03 13:44:32 +02:00
|
|
|
# Copyright (C) 2014 Alex Schroeder <alex@gnu.org>
|
|
|
|
|
#
|
|
|
|
|
# This program is free software; you can redistribute it and/or modify it under
|
|
|
|
|
# the terms of the GNU General Public License as published by the Free Software
|
|
|
|
|
# Foundation; either version 3 of the License, or (at your option) any later
|
|
|
|
|
# version.
|
|
|
|
|
#
|
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License along with
|
|
|
|
|
# this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2015-03-27 03:01:01 +02:00
|
|
|
use strict;
|
2015-08-18 10:48:03 +02:00
|
|
|
use v5.10;
|
2015-03-27 03:01:01 +02:00
|
|
|
|
2014-08-24 22:20:50 +02:00
|
|
|
AddModuleDescription('emoji.pl', 'Smilies');
|
2014-07-04 10:33:33 +02:00
|
|
|
|
2015-04-10 13:31:28 +03:00
|
|
|
our (%RuleOrder, @MyRules);
|
2015-03-27 03:01:01 +02:00
|
|
|
|
2014-07-03 13:44:32 +02:00
|
|
|
push(@MyRules, \&EmojiRule);
|
2014-08-26 22:39:39 +02:00
|
|
|
# this must come before tex.pl because of \o/ turning into ø/
|
|
|
|
|
$RuleOrder{\&EmojiRule} = 150;
|
2014-07-03 13:44:32 +02:00
|
|
|
|
2014-08-26 22:24:08 +02:00
|
|
|
# Some relevant links
|
|
|
|
|
# https://en.wikipedia.org/wiki/List_of_emoticons
|
|
|
|
|
|
2014-07-03 13:44:32 +02:00
|
|
|
sub EmojiRule {
|
|
|
|
|
if (m/\G:-?D/cg) {
|
|
|
|
|
# 😀 1F600 GRINNING FACE
|
2014-07-03 15:11:12 +02:00
|
|
|
return '😀';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G:[-o]?\)/cg) {
|
2014-07-03 14:37:16 +02:00
|
|
|
# 😊 1F60A SMILING FACE WITH SMILING EYES
|
|
|
|
|
return '😊';
|
2014-08-27 08:19:03 +02:00
|
|
|
} elsif (/\G\s+:3/cg) {
|
2014-08-26 22:24:08 +02:00
|
|
|
# 😸 1F638 GRINNING CAT FACE WITH SMILING EYES
|
2014-08-27 08:19:03 +02:00
|
|
|
return ' 😸';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G:-?\(/cg) {
|
2014-07-03 14:37:16 +02:00
|
|
|
# 😟 1F61F WORRIED FACE
|
|
|
|
|
return '😟';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G;-?\)/cg) {
|
2014-07-03 13:44:32 +02:00
|
|
|
# 😉 1F609 WINKING FACE
|
|
|
|
|
return '😉';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G:'\(/cg) {
|
2014-07-03 13:44:32 +02:00
|
|
|
# 😢 1F622 CRYING FACE
|
|
|
|
|
return '😢';
|
2014-08-26 22:34:30 +02:00
|
|
|
} elsif (/\G>:-?\(/cg) {
|
2014-07-03 14:37:16 +02:00
|
|
|
# 😠 1F620 ANGRY FACE
|
|
|
|
|
return '😠';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G:-?[Ppb]/cg) {
|
2014-07-03 13:44:32 +02:00
|
|
|
# 😝 1F61D FACE WITH STUCK-OUT TONGUE AND TIGHTLY-CLOSED EYES
|
|
|
|
|
return '😝';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G<3/cg) {
|
2014-07-03 13:44:32 +02:00
|
|
|
# ❤ 2764 HEAVY BLACK HEART
|
|
|
|
|
return '❤';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G\^_*\^/cg) {
|
2014-07-03 14:37:16 +02:00
|
|
|
# 😄 1F604 SMILING FACE WITH OPEN MOUTH AND SMILING EYES
|
|
|
|
|
return '😄';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G\b[Oo]_[Oo]\b/cg) {
|
2014-07-03 14:37:16 +02:00
|
|
|
# 😲 1F632 ASTONISHED FACE
|
|
|
|
|
return '😲';
|
2014-08-26 22:24:08 +02:00
|
|
|
} elsif (/\G\\o\//cg) {
|
|
|
|
|
# 🙌 1F64C PERSON RAISING BOTH HANDS IN CELEBRATION
|
|
|
|
|
return '🙌';
|
2014-08-26 22:34:30 +02:00
|
|
|
} elsif (/\G\\m\//cg) {
|
|
|
|
|
# ✊ 270A RAISED FIST
|
|
|
|
|
return '✊';
|
2014-07-03 13:44:32 +02:00
|
|
|
}
|
2015-02-27 12:10:18 +02:00
|
|
|
return;
|
2014-07-03 13:44:32 +02:00
|
|
|
}
|