Last active
August 9, 2022 09:39
-
-
Save notchi590/9c62bcc6508f26c4dcde315a79520777 to your computer and use it in GitHub Desktop.
slack emoji exporter written in Node.js
This file contains 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
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