I wrote a gem. It’s called EmojiSub
(the similarity to gsub
is intentional).
You can find the gem on rubygems: rubygems.org/gems/emoji_sub, or see the source on github.com/armahillo/emoji_sub. As of this writing, it is at version 0.2.2
.
It’s a very simple script that takes a text string and does a global substitution of any emoji shortcodes (a la Slack, Github, etc) and replaces them with the actual HTML entity code for the emoji.
In the process, I’ve had to learn a lot about Emoji, unicode, and how they work, it’s been a surprising topic that’s far deeper than I anticipated!
I’ll write more about the gem a bit later, once it’s more stable. There’s been a lot of steps involved in this whole process that I’ll talk about too.