Skip to content

Instantly share code, notes, and snippets.

Forked from lmarkus/README.MD
Last active November 24, 2020 23:47
  • Star 40 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Extracting / Exporting custom emoji from Slack
This builds off the excellent work of @lmarkus.
The scripts below can be used in conjunction with the Slack Emoji Tools Google Chrome extension to export emojis from
one Slack team and import into another team.
Original work here:
// Login to your team through the browser.
// Go to: https://<team name>
// Run this on the browser's dev tools javascript console
var emojis = $('.emoji_row');
var numEmojis = emojis.size();
var pre = document.createElement('pre');
emojis.each(function (index) {
var url = $(this).find('td:nth-child(1) span').attr('data-original');
var extension = url.substring(url.lastIndexOf('.'));
var name = $(this).find('td:nth-child(2)').html().replace(/:|\s/g, '');
pre.append(JSON.stringify({name: name, extension: extension, url: url}));
if (index == (numEmojis-1)) {
} else {
// Now, at the bottom of the page you'll see the json representation of all the emoji data
// copy and paste the json into a file and use with
#!/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
# ./ emojiURLs.txt
# Note: This depends on the jq utility for parsing json from the command line -
mkdir -p output;
jq -r '.[] | "curl -s -o \"output/\(.name)\(.extension)\" \"\(.url)\""' $1 | \
while read -r line; do eval "$line"; done
# You can now drag and drop all the emoji files in the output folder to the Buld Emoji Uploader space that you'll see on
# the https://<team> page if you've installed the chrome extension
Copy link

threefjefff commented May 17, 2017

Some really rough .ps1 code for step 02. Shove the json in "emojis.json", and paste in a path name:

$emojis = Get-Content -Raw -Path emojis.json | ConvertFrom-Json
Foreach($emoji in $emojis)
	Write-Host $emoji.url , $, $emoji.extension
	Invoke-WebRequest $emoji.url -OutFile "<INSERT_PATH>\$($$($emoji.extension)"

Copy link

statico commented Mar 9, 2018

Thanks for this!

For the last line of step 1 I prefer $('body').empty().append(pre) which makes it easier to select-all and copy the JSON.

Copy link

lmarkus commented Mar 27, 2018

This is awesome!
I actually forgot I did this work. I needed to extract some emoji, and started googling around to see if anyone had done it. Thanks for the improvements ❤️ !

Copy link

this is all broken. slack switched to using virtualized lists for the emoji, so someone has to write something to trigger scrolling through the emoji list, & to grab each screen full of results. these old techniques of just running querySelectorAll & compiling the results is not going to work since most of the emoji are not in the DOM at any given time.

another day where i think virtualized list components are the worst bloody thing. you really fucked up the traditional web page, mangled it real good, react-virtualized. :(

Copy link

pronvis commented Jun 28, 2018

Thanks a lot!

Copy link

My version of this gist that solves the issue @mfowlewebs brought up

Copy link

lmarkus commented Feb 2, 2019

UPDATE for 2019:
Hi folks... Author of the original gist here.
There's a much easier way to get the emoji list. I've updated the original gist, and added a Readme with the new approach.
( )

Thanks to all the folks that have contributed to enhancing this solution over the years. ❤️ OpenSource!

Enjoy your emoji, and give me a follow on twitter @lennymarkus

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