forked from omgmog/digitaloxford-slack-emojis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsonify-ish.js
24 lines (15 loc) · 651 Bytes
/
jsonify-ish.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
Crappy devtools method for getting all of the custom emoji out of slack...
Will give you the following for each:
{ "url": "url to image", "filename": "filename.ext" },
*/
var emoji = document.querySelectorAll('.emoji_row .emoji-wrapper:first-child');
var out = [];
for (var i=0;i<emoji.length;i++) {
var url = emoji[i].dataset.original;
var ext = url.split('.').pop();
var text = emoji[i].parentElement.nextSibling.nextSibling.innerText.replace(':','').replace(':','');
out.push({ url: url, filename:text+'.'+ext});
};
// Gives us one big JSON object, rather than a load of pseudo-JSON objects
console.log(JSON.stringify(out));