Search code examples
javascriptvbscript

Converting an emoji code point to it's shortcut text


I'm working on a new project and it includes allowing the user to select an emoji from a popup window using the Twemoji project for the emojis. What I'm trying to figure out is if there is a way to get the shortcut text of the emoji. I have access to the url in this fashion https://twemoji.maxcdn.com/v/14.0.2/72x72/1f605.png and I can also convert it to unicode if I need to.

For instance, I want to convert 😀 to :smiley:

I can do it server side (classic asp) or client side (vanilla js or jquery).

Edit: I found a json file that I'm going to import into a database table and do a lookup.

https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json


Solution

  • I ended up importing this json file into a local lookup database table. Works for my purpose, might help somebody else too.

    https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json