Skip to content

Instantly share code, notes, and snippets.

@thomwiggers
Created January 28, 2022 20:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomwiggers/5506e66ef63463663b48e99e2a80bc78 to your computer and use it in GitHub Desktop.
Save thomwiggers/5506e66ef63463663b48e99e2a80bc78 to your computer and use it in GitHub Desktop.
Extract slack emoji
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