update emoji list to be more like the old one but still good
This commit is contained in:
parent
ef75fd81a4
commit
295f3907e6
3 changed files with 5806 additions and 1766 deletions
|
|
@ -28,9 +28,8 @@
|
||||||
- option to disable title showing unreads
|
- option to disable title showing unreads
|
||||||
- update the list of emojis:
|
- update the list of emojis:
|
||||||
- switched weird unicode ones to proper emojis
|
- switched weird unicode ones to proper emojis
|
||||||
|
- emojis are sourced from discord's list of emojis
|
||||||
- emojis are now sorted by category (like on every other emoji picker) instead of alphabetically
|
- emojis are now sorted by category (like on every other emoji picker) instead of alphabetically
|
||||||
- all emojis go by their unicode names instead of the shortened ones, eg :100: is now :hundred_points:
|
|
||||||
- this wasn't intentional, but keeping the old names would require way more work
|
|
||||||
- script to get new emojis is included for future unicode versions
|
- script to get new emojis is included for future unicode versions
|
||||||
- add toggle for showing post edit notifications
|
- add toggle for showing post edit notifications
|
||||||
- add support for accepted follow request notifications
|
- add support for accepted follow request notifications
|
||||||
|
|
|
||||||
7546
static/emoji.json
7546
static/emoji.json
File diff suppressed because it is too large
Load diff
|
|
@ -1,13 +1,20 @@
|
||||||
# python in a js project? lunacy
|
# python in a js project? lunacy
|
||||||
|
|
||||||
import json, requests
|
import requests, json, re
|
||||||
|
|
||||||
emojiListSrc = requests.get("https://github.com/muan/unicode-emoji-json/raw/refs/heads/main/data-by-emoji.json")
|
emojilistraw = requests.get("https://github.com/xCykrix/discord_emoji/raw/refs/heads/main/mod.ts")
|
||||||
emojiList = json.loads(emojiListSrc.content)
|
emojilistraw = emojilistraw.text
|
||||||
newEmojiList = {}
|
|
||||||
|
|
||||||
for emoji in emojiList:
|
patt1 = re.compile("// deno.*\n.*\n.*\n.*\n.*\n\n.*\n.*= ")
|
||||||
newEmojiList[emojiList[emoji]["slug"]] = emoji
|
patt2 = re.compile("}\n\n.*\n.*= {\n")
|
||||||
|
patt3 = re.compile("}\n\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n.*\n")
|
||||||
|
|
||||||
output = open("../static/emoji.json", "w+")
|
patterns = [patt1, patt2, patt3]
|
||||||
output.write(json.dumps(newEmojiList, indent=4, ensure_ascii=False))
|
|
||||||
|
for pattern in patterns:
|
||||||
|
emojilistraw = re.sub(pattern, "", emojilistraw)
|
||||||
|
|
||||||
|
emojilistparsed = json.loads(emojilistraw.rpartition(",")[0] + "}")
|
||||||
|
|
||||||
|
out = open("../static/emoji.json", "w+")
|
||||||
|
out.write(json.dumps(emojilistparsed, ensure_ascii=False, indent=4))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue