diff options
author | emkael <emkael@tlen.pl> | 2017-05-06 15:25:59 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2017-05-06 15:25:59 +0200 |
commit | 039ad7e7c5cb66017430c1885dfc1201f7b3223e (patch) | |
tree | d5c07d6ff14911f676058ae1ea0e3250bc6c9c51 /bin/emoji-list.py | |
parent | 2a708631a005cdcd21798ac35cbb15c2093d6aad (diff) |
* Emoji-replacing filter
Diffstat (limited to 'bin/emoji-list.py')
-rw-r--r-- | bin/emoji-list.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/emoji-list.py b/bin/emoji-list.py new file mode 100644 index 0000000..81b73ea --- /dev/null +++ b/bin/emoji-list.py @@ -0,0 +1,15 @@ +import json, os, urllib + +emoji_list = json.load(urllib.urlopen( + 'https://raw.githubusercontent.com/iamcal/emoji-data/master/emoji.json' +)) +dictionary = {} +for emoji in emoji_list: + character = ''.join([unichr(int(nibble, 16)) for nibble in emoji['unified'].split('-')]) + name = emoji['name'].replace(' ', '_') if emoji['name'] else emoji['short_name'].upper().replace('-', '_') + dictionary[character] = ' <%s> ' % (name) + +json.dump(dictionary, file(os.path.join( + os.path.dirname(os.path.realpath(__file__)), + '../config/emoji.json' +), 'w')) |