Created
January 28, 2022 20:11
-
-
Save thomwiggers/5506e66ef63463663b48e99e2a80bc78 to your computer and use it in GitHub Desktop.
Extract slack emoji
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import time | |
import requests | |
# Go to the add emoji page on the Slack website for your team | |
# ie. https://team.slack.com/customize/emoji | |
# Open the web console, go to the networking tab, find the request to emoji.adminList (it's an ajax request) | |
# Right-click -> copy as cURL | |
# Edit cURL command such that the pagination requests more emoji than your team has | |
# Save as emoji.json in same folder as this script | |
# python3 download.py | |
data = json.load(open("emoji.json")) | |
emojis = data["emoji"] | |
for i, emoji in enumerate(emojis): | |
name = emoji["name"] | |
url = emoji["url"] | |
print(f"Fetching emoji {i}/{len(emojis)}: {name}") | |
response = requests.get(url) | |
response.raise_for_status() | |
print(f"Writing {name}") | |
ext = url.split(".")[-1] | |
with open(f"emojis/{name}.{ext}", "wb") as fh: | |
fh.write(response.content) | |
time.sleep(0.2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment