Skip to content

Instantly share code, notes, and snippets.

@notchi590
Last active August 9, 2022 09:39
Show Gist options
  • Save notchi590/9c62bcc6508f26c4dcde315a79520777 to your computer and use it in GitHub Desktop.
Save notchi590/9c62bcc6508f26c4dcde315a79520777 to your computer and use it in GitHub Desktop.
slack emoji exporter written in Node.js
var request = require('request');
var fs = require('fs');
var url = "https://slack.com/api/emoji.list?pretty=1";
var token = "Bearer <token here>";
request.get({
url : url,
headers : {
"Authorization" : token
}
}, function(error, response, body) {
jsonBlob = JSON.parse(body);
emojilist = jsonBlob.emoji
for(key in emojilist){
url = emojilist[key];
// ignore alias
if(url.match(/alias/)){
continue;
}
extention = url.match(/\.[^\.]+$/);
request
.get(url)
.on('response', function (res) {
})
.pipe(fs.createWriteStream('image/' + key + extention));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment