Last active
August 16, 2016 19:13
-
-
Save bkrodgers/e47add4103975deb9ec737f2e17ae293 to your computer and use it in GitHub Desktop.
Prompts for a slack API token and exports all emoji from the associated instance to ./output. Get your token here: https://api.slack.com/docs/oauth-test-tokens. Use https://chrome.google.com/webstore/detail/slack-emoji-tools/anchoacphlfbdomdlomnbbfhcmcdmjej to import
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
#!/bin/bash | |
token="" | |
while [[ -z "$token" ]]; do | |
read -s -p "Please enter your Slack token: " token | |
done | |
echo "" | |
mkdir -p output | |
list=$(curl https://slack.com/api/emoji.list?token=$token) | |
for key in $(echo $list | jq --raw-output '.emoji | keys | .[]'); do | |
url=$(echo $list | jq --raw-output ".emoji[\"$key\"]") | |
if [[ $url != alias* ]] ; then | |
filename=$(basename "$url") | |
ext="${filename##*.}" | |
echo "$url -> output/$key.$ext" | |
curl $url > output/$key.$ext | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment