-
-
Save qls0ulp/4f67bdc17be677e7b96841d23e14a52a to your computer and use it in GitHub Desktop.
Extracting / Exporting custom emoji from Slack
This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Use: | |
| # Make this file executable, and feed it the results from the Slack emoji URL dump. Files will be downloaded to `output` | |
| # chmod +x download.sh | |
| # ./download.sh emojiURLs.txt | |
| mkdir -p output; | |
| while read -r line || [[ -n "$line" ]]; do | |
| parts=($line) | |
| url=${parts[1]} | |
| name=${parts[0]} | |
| extension=${url##*.} | |
| echo "Downloading ${name}" | |
| curl -s -o "output/${name}.${extension}" "${url}" | |
| done < "$1" |
This file contains hidden or 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
| // Login to your team through the browser. Run this on the browsers dev tools javascript console | |
| var url, name, emoji = []; | |
| $('#emoji_ul_slack span') // This is the emoji selector's Custom section. | |
| .each(function () { | |
| // Extract the name | |
| name = $(this) | |
| .html() | |
| .replace(/:/g, ''); // without the enclosing colons. | |
| // Extract the url from the background-image property. | |
| url = $(this) | |
| .css('background-image') | |
| .replace(/.*["'](.*)['"].*/, '$1'); // Remove the`url("` and `")` portions. | |
| // Dump to console, then copy and paste the results into a file (eg: emojiURLs.txt). | |
| console.log(name,url) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment