Important Code: Exporting Slack Emojis

What is the most important thing in your life? If you say Slack emojis, then you maybe have a misplaced sense of importance, but also, I understand. One of my current slacks has over 4,000 emojis. I wanted to pull them all down so I could add the ones that aren’t inside jokes to another slack… but how? There are a number of JS scripts out there that say that they will do this but I think Slack has since updated the JSON that they send so those didn’t work anymore. Being a rubyist, I wrote a parser for that JSON to export all the emojis. Downside: I still had to download all the JSON files. If you are more ambitious than me, I’m sure there is a way to do that via JavaScript fairly easily.

  1. Go to https://your-slack.slack.com/customize/emoji

  2. Open up developer tools then the network tab.

  3. Filter by XHR or just search for emoji.adminList (might have to reload the page).

screenshot-of-emoji-file.png

4. Copy and paste into a file called emoji#{number}.json with #{number} being the file number.

5. Keep scrolling down and keep copying and pasting and creating files.

6. Download the script into the same directory

7. Run script like this: ruby download_emojis.rb NUMBER_OF_FILES_CREATED Note: NUMBER_OF_FILES_CREATED should be replaced with however many files you created. It defaults to 10.

8. The files will be created in an emojis folder with the name of the emoji as the file name.