mirror of
https://github.com/thelounge/thelounge
synced 2024-11-23 12:33:07 +00:00
35 lines
915 B
JavaScript
35 lines
915 B
JavaScript
"use strict";
|
|
|
|
const got = require("got");
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
|
|
(async () => {
|
|
const response = await got(
|
|
"https://raw.githubusercontent.com/github/gemoji/master/db/emoji.json"
|
|
);
|
|
const emojiStrategy = JSON.parse(response.body);
|
|
const emojiMap = {};
|
|
const fullNameEmojiMap = {};
|
|
|
|
for (const emoji of emojiStrategy) {
|
|
fullNameEmojiMap[emoji.emoji] = emoji.description;
|
|
|
|
for (const alias of emoji.aliases) {
|
|
emojiMap[alias] = emoji.emoji;
|
|
}
|
|
}
|
|
|
|
const emojiMapOutput = JSON.stringify(emojiMap, null, 2) + "\n";
|
|
const fullNameEmojiMapOutput = JSON.stringify(fullNameEmojiMap, null, 2) + "\n";
|
|
|
|
fs.writeFileSync(
|
|
path.resolve(path.join(__dirname, "..", "client", "js", "libs", "simplemap.json")),
|
|
emojiMapOutput
|
|
);
|
|
|
|
fs.writeFileSync(
|
|
path.resolve(path.join(__dirname, "..", "client", "js", "libs", "fullnamemap.json")),
|
|
fullNameEmojiMapOutput
|
|
);
|
|
})();
|