mirror of
https://github.com/thelounge/thelounge
synced 2024-11-14 16:27:22 +00:00
41 lines
926 B
JavaScript
41 lines
926 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);
|
|
})();
|