Skip to content

Instantly share code, notes, and snippets.

@pspaul
Last active June 24, 2020 15:27
Show Gist options
  • Save pspaul/b35639cf5b10dc679003b53f10d9c9bc to your computer and use it in GitHub Desktop.
Save pspaul/b35639cf5b10dc679003b53f10d9c9bc to your computer and use it in GitHub Desktop.
Slack custom emoji download script generator
// Usage:
// 1. Open Slack
// 2. Open the emoji picker
// 3. Scroll to the custom emojis
// 4. Open the developer tools (press F12)
// 5. Paste and run this script
// 6. Save the output as yoink.sh
// 7. Execute it
// 8. Wait a moment
// 9. Enjoy all your downloaded custom emojis!
function createDownloadScript() {
const emojiButtons = Array.from(document.querySelectorAll('button[data-qa=emoji_list_item]'));
const emojis = emojiButtons.map(btn => {
const url = btn.querySelector('img').src;
return {
url,
name: btn.dataset.name,
extension: url.split('.').reverse()[0],
};
});
const customEmojis = emojis.filter(emoji => emoji.url.startsWith('https://emoji.slack-edge.com'));
const commands = customEmojis.map(emoji => `wget "${emoji.url}" -O "${emoji.name}.${emoji.extension}"`);
const script = `#!/bin/sh\necho "Downloading ${commands.length} emojis..."\n${commands.join('\n')}`;
return script;
}
console.log(createDownloadScript());
@sylv-io
Copy link

sylv-io commented Oct 11, 2019

❤️

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