blob: e0628dc88cbcfc0a6f707c16dd089d5194a18e51 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/usr/bin/python
import json
import sys
all_emojis = json.loads(sys.stdin.read())
def convert_unicode_string(emoji_dict):
for k, v in emoji_dict.items():
if k == "unicode":
emoji_dict[k] = "".join([chr(int(x, 16)) for x in v.split("-")])
if isinstance(v, dict):
convert_unicode_string(v)
convert_unicode_string(all_emojis)
with open("weemoji.json", "w") as weemoji:
json.dump(all_emojis, weemoji, indent=2, sort_keys=True)
weemoji.write("\n")
|