Skip to content

Instantly share code, notes, and snippets.

@masutaka
Last active May 7, 2019 03:50
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 masutaka/057a7a4a1b4bbb4320b73dcb59bc7705 to your computer and use it in GitHub Desktop.
Save masutaka/057a7a4a1b4bbb4320b73dcb59bc7705 to your computer and use it in GitHub Desktop.
Export Slack custom emoji
#!/bin/sh
# You can get on https://api.slack.com/methods/emoji.list/test
endpoint='https://slack.com/api/emoji.list?token=<SECRET>&pretty=1'
json=$(curl -s $endpoint)
keys=$(echo $json | jq -r '.emoji | keys[]')
mkdir -p images
for key in $keys; do
url=$(echo $json | jq -r ".emoji[\"$key\"]")
if echo $url | grep -q -e '^alias'; then
continue
fi
echo "$key: $url"
curl -s $url > images/$key
done
@masutaka
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment