Files
radio.org.tr/fix-blog-posts.cjs
T

1817 lines
48 KiB
JavaScript
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
const fs = require('fs');
const path = require('path');
const { promisify } = require('util');
const readFile = promisify(fs.readFile);
const writeFile = promisify(fs.writeFile);
const readdir = promisify(fs.readdir);
const stat = promisify(fs.stat);
// Configuration
const config = {
postsDirectory: './src/data/post',
assetsDirectory: './src/assets/images',
backupDirectory: './blog-posts-backup',
logFile: './fix-blog-posts.log'
};
// Logging utility
class Logger {
constructor(logFile) {
this.logFile = logFile;
this.logs = [];
}
log(level, message, file = null) {
const timestamp = new Date().toISOString();
const logEntry = {
timestamp,
level,
message,
file
};
this.logs.push(logEntry);
const logString = file
? `[${timestamp}] ${level.toUpperCase()}: ${message} (${file})`
: `[${timestamp}] ${level.toUpperCase()}: ${message}`;
console.log(logString);
}
async saveLogs() {
const logContent = this.logs.map(entry =>
entry.file
? `[${entry.timestamp}] ${entry.level.toUpperCase()}: ${entry.message} (${entry.file})`
: `[${entry.timestamp}] ${entry.level.toUpperCase()}: ${entry.message}`
).join('\n');
await writeFile(this.logFile, logContent);
console.log(`\nLogs saved to ${this.logFile}`);
}
}
// HTML entities mapping
const htmlEntities = {
// Common HTML entities
'&': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&apos;': "'",
'&nbsp;': ' ',
// Extended HTML entities
'&copy;': '©',
'&reg;': '®',
'&trade;': '™',
'&hellip;': '…',
'&mdash;': '—',
'&ndash;': '',
'&ldquo;': '"',
'&rdquo;': '"',
'&lsquo;': '\u2018',
'&rsquo;': '\u2019',
'&bull;': '•',
'&middot;': '·',
'&sect;': '§',
'&para;': '¶',
'&dagger;': '†',
'&Dagger;': '‡',
'&permil;': '‰',
'&lsaquo;': '',
'&rsaquo;': '',
'&euro;': '€',
'&pound;': '£',
'&yen;': '¥',
'&cent;': '¢',
'&curren;': '¤',
// Common Unicode entities
'&#x1f3af;': '🎯',
'&#x1f4e1;': '📡',
'&#x1f4f1;': '📱',
'&#x1f4fa;': '📺',
'&#x1f4fb;': '📻',
'&#x1f4de;': '📞',
'&#x1f4df;': '📟',
'&#x1f4e2;': '📢',
'&#x1f4e3;': '📣',
'&#x1f4e4;': '📤',
'&#x1f4e5;': '📥',
'&#x1f4e6;': '📦',
'&#x1f4e7;': '📧',
'&#x1f4e8;': '📨',
'&#x1f4e9;': '📩',
'&#x1f4ea;': '📪',
'&#x1f4eb;': '📫',
'&#x1f4ec;': '📬',
'&#x1f4ed;': '📭',
'&#x1f4ee;': '📮',
'&#x1f4ef;': '📯',
'&#x1f4f0;': '📰',
'&#x1f4f2;': '📲',
'&#x1f4f3;': '📳',
'&#x1f4f4;': '📴',
'&#x1f4f5;': '📵',
'&#x1f4f6;': '📶',
'&#x1f4f7;': '📷',
'&#x1f4f8;': '📸',
'&#x1f4f9;': '📹',
'&#x1f4fc;': '📼',
'&#x1f4fd;': '📽',
'&#x1f4ff;': '📿',
'&#x1f500;': '🔀',
'&#x1f501;': '🔁',
'&#x1f502;': '🔂',
'&#x1f503;': '🔃',
'&#x1f504;': '🔄',
'&#x1f505;': '🔅',
'&#x1f506;': '🔆',
'&#x1f507;': '🔇',
'&#x1f508;': '🔈',
'&#x1f509;': '🔉',
'&#x1f50a;': '🔊',
'&#x1f50b;': '🔋',
'&#x1f50c;': '🔌',
'&#x1f50d;': '🔍',
'&#x1f50e;': '🔎',
'&#x1f50f;': '🔏',
'&#x1f510;': '🔐',
'&#x1f511;': '🔑',
'&#x1f512;': '🔒',
'&#x1f513;': '🔓',
'&#x1f514;': '🔔',
'&#x1f515;': '🔕',
'&#x1f516;': '🔖',
'&#x1f517;': '🔗',
'&#x1f518;': '🔘',
'&#x1f519;': '🔙',
'&#x1f51a;': '🔚',
'&#x1f51b;': '🔛',
'&#x1f51c;': '🔜',
'&#x1f51d;': '🔝',
'&#x1f51e;': '🔞',
'&#x1f51f;': '🔟',
'&#x1f520;': '🔠',
'&#x1f521;': '🔡',
'&#x1f522;': '🔢',
'&#x1f523;': '🔣',
'&#x1f524;': '🔤',
'&#x1f525;': '🔥',
'&#x1f526;': '🔦',
'&#x1f527;': '🔧',
'&#x1f528;': '🔨',
'&#x1f529;': '🔩',
'&#x1f52a;': '🔪',
'&#x1f52b;': '🔫',
'&#x1f52c;': '🔬',
'&#x1f52d;': '🔭',
'&#x1f52e;': '🔮',
'&#x1f52f;': '🔯',
'&#x1f530;': '🔰',
'&#x1f531;': '🔱',
'&#x1f532;': '🔲',
'&#x1f533;': '🔳',
'&#x1f534;': '🔴',
'&#x1f535;': '🔵',
'&#x1f536;': '🔶',
'&#x1f537;': '🔷',
'&#x1f538;': '🔸',
'&#x1f539;': '🔹',
'&#x1f53a;': '🔺',
'&#x1f53b;': '🔻',
'&#x1f53c;': '🔼',
'&#x1f53d;': '🔽',
'&#x1f680;': '🚀',
'&#x1f681;': '🚁',
'&#x1f682;': '🚂',
'&#x1f683;': '🚃',
'&#x1f684;': '🚄',
'&#x1f685;': '🚅',
'&#x1f686;': '🚆',
'&#x1f687;': '🚇',
'&#x1f688;': '🚈',
'&#x1f689;': '🚉',
'&#x1f6a0;': '🚠',
'&#x1f6a1;': '🚡',
'&#x1f6a2;': '🚢',
'&#x1f6a3;': '🚣',
'&#x1f6a4;': '🚤',
'&#x1f6a5;': '🚥',
'&#x1f6a6;': '🚦',
'&#x1f6a7;': '🚧',
'&#x1f6a8;': '🚨',
'&#x1f6a9;': '🚩',
'&#x1f6aa;': '🚪',
'&#x1f6ab;': '🚫',
'&#x1f6ac;': '🚬',
'&#x1f6ad;': '🚭',
'&#x1f6ae;': '🚮',
'&#x1f6af;': '🚯',
'&#x1f6b0;': '🚰',
'&#x1f6b1;': '🚱',
'&#x1f6b2;': '🚲',
'&#x1f6b3;': '🚳',
'&#x1f6b4;': '🚴',
'&#x1f6b5;': '🚵',
'&#x1f6b6;': '🚶',
'&#x1f6b7;': '🚷',
'&#x1f6b8;': '🚸',
'&#x1f6b9;': '🚹',
'&#x1f6ba;': '🚺',
'&#x1f6bb;': '🚻',
'&#x1f6bc;': '🚼',
'&#x1f6bd;': '🚽',
'&#x1f6be;': '🚾',
'&#x1f6bf;': '🚿',
'&#x1f6c0;': '🛀',
'&#x1f6c1;': '🛁',
'&#x1f6c2;': '🛂',
'&#x1f6c3;': '🛃',
'&#x1f6c4;': '🛄',
'&#x1f6c5;': '🛅',
'&#x1f30d;': '🌍',
'&#x1f30e;': '🌎',
'&#x1f30f;': '🌏',
'&#x1f310;': '🌐',
'&#x1f311;': '🌑',
'&#x1f312;': '🌒',
'&#x1f313;': '🌓',
'&#x1f314;': '🌔',
'&#x1f315;': '🌕',
'&#x1f316;': '🌖',
'&#x1f317;': '🌗',
'&#x1f318;': '🌘',
'&#x1f319;': '🌙',
'&#x1f31a;': '🌚',
'&#x1f31b;': '🌛',
'&#x1f31c;': '🌜',
'&#x1f31d;': '🌝',
'&#x1f31e;': '🌞',
'&#x1f31f;': '🌟',
'&#x1f320;': '🌠',
'&#x1f321;': '🌡',
'&#x1f324;': '🌤',
'&#x1f325;': '🌥',
'&#x1f326;': '🌦',
'&#x1f327;': '🌧',
'&#x1f328;': '🌨',
'&#x1f329;': '🌩',
'&#x1f32a;': '🌪',
'&#x1f32b;': '🌫',
'&#x1f32c;': '🌬',
'&#x1f32d;': '🌭',
'&#x1f32e;': '🌮',
'&#x1f32f;': '🌯',
'&#x1f330;': '🌰',
'&#x1f331;': '🌱',
'&#x1f332;': '🌲',
'&#x1f333;': '🌳',
'&#x1f334;': '🌴',
'&#x1f335;': '🌵',
'&#x1f336;': '🌶',
'&#x1f337;': '🌷',
'&#x1f338;': '🌸',
'&#x1f339;': '🌹',
'&#x1f33a;': '🌺',
'&#x1f33b;': '🌻',
'&#x1f33c;': '🌼',
'&#x1f33d;': '🌽',
'&#x1f33e;': '🌾',
'&#x1f33f;': '🌿',
'&#x1f340;': '🍀',
'&#x1f341;': '🍁',
'&#x1f342;': '🍂',
'&#x1f343;': '🍃',
'&#x1f344;': '🍄',
'&#x1f345;': '🍅',
'&#x1f346;': '🍆',
'&#x1f347;': '🍇',
'&#x1f348;': '🍈',
'&#x1f349;': '🍉',
'&#x1f34a;': '🍊',
'&#x1f34b;': '🍋',
'&#x1f34c;': '🍌',
'&#x1f34d;': '🍍',
'&#x1f34e;': '🍎',
'&#x1f34f;': '🍏',
'&#x1f350;': '🍐',
'&#x1f351;': '🍑',
'&#x1f352;': '🍒',
'&#x1f353;': '🍓',
'&#x1f354;': '🍔',
'&#x1f355;': '🍕',
'&#x1f356;': '🍖',
'&#x1f357;': '🍗',
'&#x1f358;': '🍘',
'&#x1f359;': '🍙',
'&#x1f35a;': '🍚',
'&#x1f35b;': '🍛',
'&#x1f35c;': '🍜',
'&#x1f35d;': '🍝',
'&#x1f35e;': '🍞',
'&#x1f35f;': '🍟',
'&#x1f360;': '🍠',
'&#x1f361;': '🍡',
'&#x1f362;': '🍢',
'&#x1f363;': '🍣',
'&#x1f364;': '🍤',
'&#x1f365;': '🍥',
'&#x1f366;': '🍦',
'&#x1f367;': '🍧',
'&#x1f368;': '🍨',
'&#x1f369;': '🍩',
'&#x1f36a;': '🍪',
'&#x1f36b;': '🍫',
'&#x1f36c;': '🍬',
'&#x1f36d;': '🍭',
'&#x1f36e;': '🍮',
'&#x1f36f;': '🍯',
'&#x1f370;': '🍰',
'&#x1f371;': '🍱',
'&#x1f372;': '🍲',
'&#x1f373;': '🍳',
'&#x1f374;': '🍴',
'&#x1f375;': '🍵',
'&#x1f376;': '🍶',
'&#x1f377;': '🍷',
'&#x1f378;': '🍸',
'&#x1f379;': '🍹',
'&#x1f37a;': '🍺',
'&#x1f37b;': '🍻',
'&#x1f37c;': '🍼',
'&#x1f37d;': '🍽',
'&#x1f37e;': '🍾',
'&#x1f37f;': '🍿',
'&#x1f380;': '🎀',
'&#x1f381;': '🎁',
'&#x1f382;': '🎂',
'&#x1f383;': '🎃',
'&#x1f384;': '🎄',
'&#x1f385;': '🎅',
'&#x1f386;': '🎆',
'&#x1f387;': '🎇',
'&#x1f388;': '🎈',
'&#x1f389;': '🎉',
'&#x1f38a;': '🎊',
'&#x1f38b;': '🎋',
'&#x1f38c;': '🎌',
'&#x1f38d;': '🎍',
'&#x1f38e;': '🎎',
'&#x1f38f;': '🎏',
'&#x1f390;': '🎐',
'&#x1f391;': '🎑',
'&#x1f392;': '🎒',
'&#x1f393;': '🎓',
'&#x1f396;': '🎖',
'&#x1f397;': '🎗',
'&#x1f399;': '🎙',
'&#x1f39a;': '🎚',
'&#x1f39b;': '🎛',
'&#x1f39e;': '🎞',
'&#x1f39f;': '🎟',
'&#x1f3a0;': '🎠',
'&#x1f3a1;': '🎡',
'&#x1f3a2;': '🎢',
'&#x1f3a3;': '🎣',
'&#x1f3a4;': '🎤',
'&#x1f3a5;': '🎥',
'&#x1f3a6;': '🎦',
'&#x1f3a7;': '🎧',
'&#x1f3a8;': '🎨',
'&#x1f3a9;': '🎩',
'&#x1f3aa;': '🎪',
'&#x1f3ab;': '🎫',
'&#x1f3ac;': '🎬',
'&#x1f3ad;': '🎭',
'&#x1f3ae;': '🎮',
'&#x1f3b0;': '🎰',
'&#x1f3b1;': '🎱',
'&#x1f3b2;': '🎲',
'&#x1f3b3;': '🎳',
'&#x1f3b4;': '🎴',
'&#x1f3b5;': '🎵',
'&#x1f3b6;': '🎶',
'&#x1f3b7;': '🎷',
'&#x1f3b8;': '🎸',
'&#x1f3b9;': '🎹',
'&#x1f3ba;': '🎺',
'&#x1f3bb;': '🎻',
'&#x1f3bc;': '🎼',
'&#x1f3bd;': '🎽',
'&#x1f3be;': '🎾',
'&#x1f3bf;': '🎿',
'&#x1f3c0;': '🏀',
'&#x1f3c1;': '🏁',
'&#x1f3c2;': '🏂',
'&#x1f3c3;': '🏃',
'&#x1f3c4;': '🏄',
'&#x1f3c5;': '🏅',
'&#x1f3c6;': '🏆',
'&#x1f3c7;': '🏇',
'&#x1f3c8;': '🏈',
'&#x1f3c9;': '🏉',
'&#x1f3ca;': '🏊',
'&#x1f3cb;': '🏋',
'&#x1f3cc;': '🏌',
'&#x1f3cd;': '🏍',
'&#x1f3ce;': '🏎',
'&#x1f3cf;': '🏏',
'&#x1f3d0;': '🏐',
'&#x1f3d1;': '🏑',
'&#x1f3d2;': '🏒',
'&#x1f3d3;': '🏓',
'&#x1f3d4;': '🏔',
'&#x1f3d5;': '🏕',
'&#x1f3d6;': '🏖',
'&#x1f3d7;': '🏗',
'&#x1f3d8;': '🏘',
'&#x1f3d9;': '🏙',
'&#x1f3da;': '🏚',
'&#x1f3db;': '🏛',
'&#x1f3dc;': '🏜',
'&#x1f3dd;': '🏝',
'&#x1f3de;': '🏞',
'&#x1f3df;': '🏟',
'&#x1f3e0;': '🏠',
'&#x1f3e1;': '🏡',
'&#x1f3e2;': '🏢',
'&#x1f3e3;': '🏣',
'&#x1f3e4;': '🏤',
'&#x1f3e5;': '🏥',
'&#x1f3e6;': '🏦',
'&#x1f3e7;': '🏧',
'&#x1f3e8;': '🏨',
'&#x1f3e9;': '🏩',
'&#x1f3ea;': '🏪',
'&#x1f3eb;': '🏫',
'&#x1f3ec;': '🏬',
'&#x1f3ed;': '🏭',
'&#x1f3ee;': '🏮',
'&#x1f3ef;': '🏯',
'&#x1f3f0;': '🏰',
'&#x1f3f3;': '🏳',
'&#x1f3f4;': '🏴',
'&#x1f3f5;': '🏵',
'&#x1f3f7;': '🏷',
'&#x1f3f8;': '🏸',
'&#x1f3f9;': '🏹',
'&#x1f3fa;': '🏺',
'&#x1f3fb;': '🏻',
'&#x1f3fc;': '🏼',
'&#x1f3fd;': '🏽',
'&#x1f3fe;': '🏾',
'&#x1f3ff;': '🏿',
'&#x1f400;': '🐀',
'&#x1f401;': '🐁',
'&#x1f402;': '🐂',
'&#x1f403;': '🐃',
'&#x1f404;': '🐄',
'&#x1f405;': '🐅',
'&#x1f406;': '🐆',
'&#x1f407;': '🐇',
'&#x1f408;': '🐈',
'&#x1f409;': '🐉',
'&#x1f40a;': '🐊',
'&#x1f40b;': '🐋',
'&#x1f40c;': '🐌',
'&#x1f40d;': '🐍',
'&#x1f40e;': '🐎',
'&#x1f40f;': '🐏',
'&#x1f410;': '🐐',
'&#x1f411;': '🐑',
'&#x1f412;': '🐒',
'&#x1f413;': '🐓',
'&#x1f414;': '🐔',
'&#x1f415;': '🐕',
'&#x1f416;': '🐖',
'&#x1f417;': '🐗',
'&#x1f418;': '🐘',
'&#x1f419;': '🐙',
'&#x1f41a;': '🐚',
'&#x1f41b;': '🐛',
'&#x1f41c;': '🐜',
'&#x1f41d;': '🐝',
'&#x1f41e;': '🐞',
'&#x1f41f;': '🐟',
'&#x1f420;': '🐠',
'&#x1f421;': '🐡',
'&#x1f422;': '🐢',
'&#x1f423;': '🐣',
'&#x1f424;': '🐤',
'&#x1f425;': '🐥',
'&#x1f426;': '🐦',
'&#x1f427;': '🐧',
'&#x1f428;': '🐨',
'&#x1f429;': '🐩',
'&#x1f42a;': '🐪',
'&#x1f42b;': '🐫',
'&#x1f42c;': '🐬',
'&#x1f42d;': '🐭',
'&#x1f42e;': '🐮',
'&#x1f42f;': '🐯',
'&#x1f430;': '🐰',
'&#x1f431;': '🐱',
'&#x1f432;': '🐲',
'&#x1f433;': '🐳',
'&#x1f434;': '🐴',
'&#x1f435;': '🐵',
'&#x1f436;': '🐶',
'&#x1f437;': '🐷',
'&#x1f438;': '🐸',
'&#x1f439;': '🐹',
'&#x1f43a;': '🐺',
'&#x1f43b;': '🐻',
'&#x1f43c;': '🐼',
'&#x1f43d;': '🐽',
'&#x1f43e;': '🐾',
'&#x1f43f;': '🐿',
'&#x1f440;': '👀',
'&#x1f441;': '👁',
'&#x1f442;': '👂',
'&#x1f443;': '👃',
'&#x1f444;': '👄',
'&#x1f445;': '👅',
'&#x1f446;': '👆',
'&#x1f447;': '👇',
'&#x1f448;': '👈',
'&#x1f449;': '👉',
'&#x1f44a;': '👊',
'&#x1f44b;': '👋',
'&#x1f44c;': '👌',
'&#x1f44d;': '👍',
'&#x1f44e;': '👎',
'&#x1f44f;': '👏',
'&#x1f450;': '👐',
'&#x1f451;': '👑',
'&#x1f452;': '👒',
'&#x1f453;': '👓',
'&#x1f454;': '👔',
'&#x1f455;': '👕',
'&#x1f456;': '👖',
'&#x1f457;': '👗',
'&#x1f458;': '👘',
'&#x1f459;': '👙',
'&#x1f45a;': '👚',
'&#x1f45b;': '👛',
'&#x1f45c;': '👜',
'&#x1f45d;': '👝',
'&#x1f45e;': '👞',
'&#x1f45f;': '👟',
'&#x1f460;': '👠',
'&#x1f461;': '👡',
'&#x1f462;': '👢',
'&#x1f463;': '👣',
'&#x1f464;': '👤',
'&#x1f465;': '👥',
'&#x1f466;': '👦',
'&#x1f467;': '👧',
'&#x1f468;': '👨',
'&#x1f469;': '👩',
'&#x1f46a;': '👪',
'&#x1f46b;': '👫',
'&#x1f46c;': '👬',
'&#x1f46d;': '👭',
'&#x1f46e;': '👮',
'&#x1f46f;': '👯',
'&#x1f470;': '👰',
'&#x1f471;': '👱',
'&#x1f472;': '👲',
'&#x1f473;': '👳',
'&#x1f474;': '👴',
'&#x1f475;': '👵',
'&#x1f476;': '👶',
'&#x1f477;': '👷',
'&#x1f478;': '👸',
'&#x1f479;': '👹',
'&#x1f47a;': '👺',
'&#x1f47b;': '👻',
'&#x1f47c;': '👼',
'&#x1f47d;': '👽',
'&#x1f47e;': '👾',
'&#x1f47f;': '👿',
'&#x1f480;': '💀',
'&#x1f481;': '💁',
'&#x1f482;': '💂',
'&#x1f483;': '💃',
'&#x1f484;': '💄',
'&#x1f485;': '💅',
'&#x1f486;': '💆',
'&#x1f487;': '💇',
'&#x1f488;': '💈',
'&#x1f489;': '💉',
'&#x1f48a;': '💊',
'&#x1f48b;': '💋',
'&#x1f48c;': '💌',
'&#x1f48d;': '💍',
'&#x1f48e;': '💎',
'&#x1f48f;': '💏',
'&#x1f490;': '💐',
'&#x1f491;': '💑',
'&#x1f492;': '💒',
'&#x1f493;': '💓',
'&#x1f494;': '💔',
'&#x1f495;': '💕',
'&#x1f496;': '💖',
'&#x1f497;': '💗',
'&#x1f498;': '💘',
'&#x1f499;': '💙',
'&#x1f49a;': '💚',
'&#x1f49b;': '💛',
'&#x1f49c;': '💜',
'&#x1f49d;': '💝',
'&#x1f49e;': '💞',
'&#x1f49f;': '💟',
'&#x1f4a0;': '💠',
'&#x1f4a1;': '💡',
'&#x1f4a2;': '💢',
'&#x1f4a3;': '💣',
'&#x1f4a4;': '💤',
'&#x1f4a5;': '💥',
'&#x1f4a6;': '💦',
'&#x1f4a7;': '💧',
'&#x1f4a8;': '💨',
'&#x1f4a9;': '💩',
'&#x1f4aa;': '💪',
'&#x1f4ab;': '💫',
'&#x1f4ac;': '💬',
'&#x1f4ad;': '💭',
'&#x1f4ae;': '💮',
'&#x1f4af;': '💯',
'&#x1f4b0;': '💰',
'&#x1f4b1;': '💱',
'&#x1f4b2;': '💲',
'&#x1f4b3;': '💳',
'&#x1f4b4;': '💴',
'&#x1f4b5;': '💵',
'&#x1f4b6;': '💶',
'&#x1f4b7;': '💷',
'&#x1f4b8;': '💸',
'&#x1f4b9;': '💹',
'&#x1f4ba;': '💺',
'&#x1f4bb;': '💻',
'&#x1f4bc;': '💼',
'&#x1f4bd;': '💽',
'&#x1f4be;': '💾',
'&#x1f4bf;': '💿',
'&#x1f4c0;': '📀',
'&#x1f4c1;': '📁',
'&#x1f4c2;': '📂',
'&#x1f4c3;': '📃',
'&#x1f4c4;': '📄',
'&#x1f4c5;': '📅',
'&#x1f4c6;': '📆',
'&#x1f4c7;': '📇',
'&#x1f4c8;': '📈',
'&#x1f4c9;': '📉',
'&#x1f4ca;': '📊',
'&#x1f4cb;': '📋',
'&#x1f4cc;': '📌',
'&#x1f4cd;': '📍',
'&#x1f4ce;': '📎',
'&#x1f4cf;': '📏',
'&#x1f4d0;': '📐',
'&#x1f4d1;': '📑',
'&#x1f4d2;': '📒',
'&#x1f4d3;': '📓',
'&#x1f4d4;': '📔',
'&#x1f4d5;': '📕',
'&#x1f4d6;': '📖',
'&#x1f4d7;': '📗',
'&#x1f4d8;': '📘',
'&#x1f4d9;': '📙',
'&#x1f4da;': '📚',
'&#x1f4db;': '📛',
'&#x1f4dc;': '📜',
'&#x1f4dd;': '📝',
'&#x1f4de;': '📞',
'&#x1f4df;': '📟',
'&#x1f4e0;': '📠',
'&#x1f4e1;': '📡',
'&#x1f4e2;': '📢',
'&#x1f4e3;': '📣',
'&#x1f4e4;': '📤',
'&#x1f4e5;': '📥',
'&#x1f4e6;': '📦',
'&#x1f4e7;': '📧',
'&#x1f4e8;': '📨',
'&#x1f4e9;': '📩',
'&#x1f4ea;': '📪',
'&#x1f4eb;': '📫',
'&#x1f4ec;': '📬',
'&#x1f4ed;': '📭',
'&#x1f4ee;': '📮',
'&#x1f4ef;': '📯',
'&#x1f4f0;': '📰',
'&#x1f4f1;': '📱',
'&#x1f4f2;': '📲',
'&#x1f4f3;': '📳',
'&#x1f4f4;': '📴',
'&#x1f4f5;': '📵',
'&#x1f4f6;': '📶',
'&#x1f4f7;': '📷',
'&#x1f4f8;': '📸',
'&#x1f4f9;': '📹',
'&#x1f4fa;': '📺',
'&#x1f4fb;': '📻',
'&#x1f4fc;': '📼',
'&#x1f4fd;': '📽',
'&#x1f4ff;': '📿',
'&#x1f500;': '🔀',
'&#x1f501;': '🔁',
'&#x1f502;': '🔂',
'&#x1f503;': '🔃',
'&#x1f504;': '🔄',
'&#x1f505;': '🔅',
'&#x1f506;': '🔆',
'&#x1f507;': '🔇',
'&#x1f508;': '🔈',
'&#x1f509;': '🔉',
'&#x1f50a;': '🔊',
'&#x1f50b;': '🔋',
'&#x1f50c;': '🔌',
'&#x1f50d;': '🔍',
'&#x1f50e;': '🔎',
'&#x1f50f;': '🔏',
'&#x1f510;': '🔐',
'&#x1f511;': '🔑',
'&#x1f512;': '🔒',
'&#x1f513;': '🔓',
'&#x1f514;': '🔔',
'&#x1f515;': '🔕',
'&#x1f516;': '🔖',
'&#x1f517;': '🔗',
'&#x1f518;': '🔘',
'&#x1f519;': '🔙',
'&#x1f51a;': '🔚',
'&#x1f51b;': '🔛',
'&#x1f51c;': '🔜',
'&#x1f51d;': '🔝',
'&#x1f51e;': '🔞',
'&#x1f51f;': '🔟',
'&#x1f520;': '🔠',
'&#x1f521;': '🔡',
'&#x1f522;': '🔢',
'&#x1f523;': '🔣',
'&#x1f524;': '🔤',
'&#x1f525;': '🔥',
'&#x1f526;': '🔦',
'&#x1f527;': '🔧',
'&#x1f528;': '🔨',
'&#x1f529;': '🔩',
'&#x1f52a;': '🔪',
'&#x1f52b;': '🔫',
'&#x1f52c;': '🔬',
'&#x1f52d;': '🔭',
'&#x1f52e;': '🔮',
'&#x1f52f;': '🔯',
'&#x1f530;': '🔰',
'&#x1f531;': '🔱',
'&#x1f532;': '🔲',
'&#x1f533;': '🔳',
'&#x1f534;': '🔴',
'&#x1f535;': '🔵',
'&#x1f536;': '🔶',
'&#x1f537;': '🔷',
'&#x1f538;': '🔸',
'&#x1f539;': '🔹',
'&#x1f53a;': '🔺',
'&#x1f53b;': '🔻',
'&#x1f53c;': '🔼',
'&#x1f53d;': '🔽',
'&#x1f549;': '🕉',
'&#x1f54a;': '🕊',
'&#x1f54b;': '🕋',
'&#x1f54c;': '🕌',
'&#x1f54d;': '🕍',
'&#x1f54e;': '🕎',
'&#x1f550;': '🕐',
'&#x1f551;': '🕑',
'&#x1f552;': '🕒',
'&#x1f553;': '🕓',
'&#x1f554;': '🕔',
'&#x1f555;': '🕕',
'&#x1f556;': '🕖',
'&#x1f557;': '🕗',
'&#x1f558;': '🕘',
'&#x1f559;': '🕙',
'&#x1f55a;': '🕚',
'&#x1f55b;': '🕛',
'&#x1f55c;': '🕜',
'&#x1f55d;': '🕝',
'&#x1f55e;': '🕞',
'&#x1f55f;': '🕟',
'&#x1f560;': '🕠',
'&#x1f561;': '🕡',
'&#x1f562;': '🕢',
'&#x1f563;': '🕣',
'&#x1f564;': '🕤',
'&#x1f565;': '🕥',
'&#x1f566;': '🕦',
'&#x1f567;': '🕧',
'&#x1f56f;': '🕯',
'&#x1f570;': '🕰',
'&#x1f573;': '🕳',
'&#x1f574;': '🕴',
'&#x1f575;': '🕵',
'&#x1f576;': '🕶',
'&#x1f577;': '🕷',
'&#x1f578;': '🕸',
'&#x1f579;': '🕹',
'&#x1f57a;': '🕺',
'&#x1f587;': '🖇',
'&#x1f58a;': '🖊',
'&#x1f58b;': '🖋',
'&#x1f58c;': '🖌',
'&#x1f58d;': '🖍',
'&#x1f590;': '🖐',
'&#x1f595;': '🖕',
'&#x1f596;': '🖖',
'&#x1f5a4;': '🖤',
'&#x1f5a5;': '🖥',
'&#x1f5a8;': '🖨',
'&#x1f5b1;': '🖱',
'&#x1f5b2;': '🖲',
'&#x1f5bc;': '🖼',
'&#x1f5c2;': '🗂',
'&#x1f5c3;': '🗃',
'&#x1f5c4;': '🗄',
'&#x1f5d1;': '🗑',
'&#x1f5d2;': '🗒',
'&#x1f5d3;': '🗓',
'&#x1f5dc;': '🗜',
'&#x1f5dd;': '🗝',
'&#x1f5de;': '🗞',
'&#x1f5e1;': '🗡',
'&#x1f5e3;': '🗣',
'&#x1f5e8;': '🗨',
'&#x1f5ef;': '🗯',
'&#x1f5f3;': '🗳',
'&#x1f5fa;': '🗺',
'&#x1f5fb;': '🗻',
'&#x1f5fc;': '🗼',
'&#x1f5fd;': '🗽',
'&#x1f5fe;': '🗾',
'&#x1f5ff;': '🗿',
'&#x1f600;': '😀',
'&#x1f601;': '😁',
'&#x1f602;': '😂',
'&#x1f603;': '😃',
'&#x1f604;': '😄',
'&#x1f605;': '😅',
'&#x1f606;': '😆',
'&#x1f607;': '😇',
'&#x1f608;': '😈',
'&#x1f609;': '😉',
'&#x1f60a;': '😊',
'&#x1f60b;': '😋',
'&#x1f60c;': '😌',
'&#x1f60d;': '😍',
'&#x1f60e;': '😎',
'&#x1f60f;': '😏',
'&#x1f610;': '😐',
'&#x1f611;': '😑',
'&#x1f612;': '😒',
'&#x1f613;': '😓',
'&#x1f614;': '😔',
'&#x1f615;': '😕',
'&#x1f616;': '😖',
'&#x1f617;': '😗',
'&#x1f618;': '😘',
'&#x1f619;': '😙',
'&#x1f61a;': '😚',
'&#x1f61b;': '😛',
'&#x1f61c;': '😜',
'&#x1f61d;': '😝',
'&#x1f61e;': '😞',
'&#x1f61f;': '😟',
'&#x1f620;': '😠',
'&#x1f621;': '😡',
'&#x1f622;': '😢',
'&#x1f623;': '😣',
'&#x1f624;': '😤',
'&#x1f625;': '😥',
'&#x1f626;': '😦',
'&#x1f627;': '😧',
'&#x1f628;': '😨',
'&#x1f629;': '😩',
'&#x1f62a;': '😪',
'&#x1f62b;': '😫',
'&#x1f62c;': '😬',
'&#x1f62d;': '😭',
'&#x1f62e;': '😮',
'&#x1f62f;': '😯',
'&#x1f630;': '😰',
'&#x1f631;': '😱',
'&#x1f632;': '😲',
'&#x1f633;': '😳',
'&#x1f634;': '😴',
'&#x1f635;': '😵',
'&#x1f636;': '😶',
'&#x1f637;': '😷',
'&#x1f638;': '😸',
'&#x1f639;': '😹',
'&#x1f63a;': '😺',
'&#x1f63b;': '😻',
'&#x1f63c;': '😼',
'&#x1f63d;': '😽',
'&#x1f63e;': '😾',
'&#x1f63f;': '😿',
'&#x1f640;': '🙀',
'&#x1f641;': '🙁',
'&#x1f642;': '🙂',
'&#x1f643;': '🙃',
'&#x1f644;': '🙄',
'&#x1f645;': '🙅',
'&#x1f646;': '🙆',
'&#x1f647;': '🙇',
'&#x1f648;': '🙈',
'&#x1f649;': '🙉',
'&#x1f64a;': '🙊',
'&#x1f64b;': '🙋',
'&#x1f64c;': '🙌',
'&#x1f64d;': '🙍',
'&#x1f64e;': '🙎',
'&#x1f64f;': '🙏',
'&#x1f680;': '🚀',
'&#x1f681;': '🚁',
'&#x1f682;': '🚂',
'&#x1f683;': '🚃',
'&#x1f684;': '🚄',
'&#x1f685;': '🚅',
'&#x1f686;': '🚆',
'&#x1f687;': '🚇',
'&#x1f688;': '🚈',
'&#x1f689;': '🚉',
'&#x1f68a;': '🚊',
'&#x1f68b;': '🚋',
'&#x1f68c;': '🚌',
'&#x1f68d;': '🚍',
'&#x1f68e;': '🚎',
'&#x1f68f;': '🚏',
'&#x1f690;': '🚐',
'&#x1f691;': '🚑',
'&#x1f692;': '🚒',
'&#x1f693;': '🚓',
'&#x1f694;': '🚔',
'&#x1f695;': '🚕',
'&#x1f696;': '🚖',
'&#x1f697;': '🚗',
'&#x1f698;': '🚘',
'&#x1f699;': '🚙',
'&#x1f69a;': '🚚',
'&#x1f69b;': '🚛',
'&#x1f69c;': '🚜',
'&#x1f69d;': '🚝',
'&#x1f69e;': '🚞',
'&#x1f69f;': '🚟',
'&#x1f6a0;': '🚠',
'&#x1f6a1;': '🚡',
'&#x1f6a2;': '🚢',
'&#x1f6a3;': '🚣',
'&#x1f6a4;': '🚤',
'&#x1f6a5;': '🚥',
'&#x1f6a6;': '🚦',
'&#x1f6a7;': '🚧',
'&#x1f6a8;': '🚨',
'&#x1f6a9;': '🚩',
'&#x1f6aa;': '🚪',
'&#x1f6ab;': '🚫',
'&#x1f6ac;': '🚬',
'&#x1f6ad;': '🚭',
'&#x1f6ae;': '🚮',
'&#x1f6af;': '🚯',
'&#x1f6b0;': '🚰',
'&#x1f6b1;': '🚱',
'&#x1f6b2;': '🚲',
'&#x1f6b3;': '🚳',
'&#x1f6b4;': '🚴',
'&#x1f6b5;': '🚵',
'&#x1f6b6;': '🚶',
'&#x1f6b7;': '🚷',
'&#x1f6b8;': '🚸',
'&#x1f6b9;': '🚹',
'&#x1f6ba;': '🚺',
'&#x1f6bb;': '🚻',
'&#x1f6bc;': '🚼',
'&#x1f6bd;': '🚽',
'&#x1f6be;': '🚾',
'&#x1f6bf;': '🚿',
'&#x1f6c0;': '🛀',
'&#x1f6c1;': '🛁',
'&#x1f6c2;': '🛂',
'&#x1f6c3;': '🛃',
'&#x1f6c4;': '🛄',
'&#x1f6c5;': '🛅',
'&#x1f6cb;': '🛋',
'&#x1f6cc;': '🛌',
'&#x1f6cd;': '🛍',
'&#x1f6ce;': '🛎',
'&#x1f6cf;': '🛏',
'&#x1f6d0;': '🛐',
'&#x1f6d1;': '🛑',
'&#x1f6d2;': '🛒',
'&#x1f6d5;': '🛕',
'&#x1f6e0;': '🛠',
'&#x1f6e1;': '🛡',
'&#x1f6e2;': '🛢',
'&#x1f6e3;': '🛣',
'&#x1f6e4;': '🛤',
'&#x1f6e5;': '🛥',
'&#x1f6e9;': '🛩',
'&#x1f6eb;': '🛫',
'&#x1f6ec;': '🛬',
'&#x1f6f0;': '🛰',
'&#x1f6f3;': '🛳',
'&#x1f6f4;': '🛴',
'&#x1f6f5;': '🛵',
'&#x1f6f6;': '🛶',
'&#x1f6f7;': '🛷',
'&#x1f6f8;': '🛸',
'&#x1f6f9;': '🛹',
'&#x1f6fa;': '🛺',
'&#x1f7e0;': '🟠',
'&#x1f7e1;': '🟡',
'&#x1f7e2;': '🟢',
'&#x1f7e3;': '🟣',
'&#x1f7e4;': '🟤',
'&#x1f7e5;': '🟥',
'&#x1f7e6;': '🟦',
'&#x1f7e7;': '🟧',
'&#x1f7e8;': '🟨',
'&#x1f7e9;': '🟩',
'&#x1f7ea;': '🟪',
'&#x1f7eb;': '🟫',
'&#x1f90d;': '🤍',
'&#x1f90e;': '🤎',
'&#x1f90f;': '🤏',
'&#x1f910;': '🤐',
'&#x1f911;': '🤑',
'&#x1f912;': '🤒',
'&#x1f913;': '🤓',
'&#x1f914;': '🤔',
'&#x1f915;': '🤕',
'&#x1f916;': '🤖',
'&#x1f917;': '🤗',
'&#x1f918;': '🤘',
'&#x1f919;': '🤙',
'&#x1f91a;': '🤚',
'&#x1f91b;': '🤛',
'&#x1f91c;': '🤜',
'&#x1f91d;': '🤝',
'&#x1f91e;': '🤞',
'&#x1f91f;': '🤟',
'&#x1f920;': '🤠',
'&#x1f921;': '🤡',
'&#x1f922;': '🤢',
'&#x1f923;': '🤣',
'&#x1f924;': '🤤',
'&#x1f925;': '🤥',
'&#x1f926;': '🤦',
'&#x1f927;': '🤧',
'&#x1f928;': '🤨',
'&#x1f929;': '🤩',
'&#x1f92a;': '🤪',
'&#x1f92b;': '🤫',
'&#x1f92c;': '🤬',
'&#x1f92d;': '🤭',
'&#x1f92e;': '🤮',
'&#x1f92f;': '🤯',
'&#x1f930;': '🤰',
'&#x1f931;': '🤱',
'&#x1f932;': '🤲',
'&#x1f933;': '🤳',
'&#x1f934;': '🤴',
'&#x1f935;': '🤵',
'&#x1f936;': '🤶',
'&#x1f937;': '🤷',
'&#x1f938;': '🤸',
'&#x1f939;': '🤹',
'&#x1f93a;': '🤺',
'&#x1f93c;': '🤼',
'&#x1f93d;': '🤽',
'&#x1f93e;': '🤾',
'&#x1f940;': '🥀',
'&#x1f941;': '🥁',
'&#x1f942;': '🥂',
'&#x1f943;': '🥃',
'&#x1f944;': '🥄',
'&#x1f945;': '🥅',
'&#x1f947;': '🥇',
'&#x1f948;': '🥈',
'&#x1f949;': '🥉',
'&#x1f94a;': '🥊',
'&#x1f94b;': '🥋',
'&#x1f94c;': '🥌',
'&#x1f94d;': '🥍',
'&#x1f94e;': '🥎',
'&#x1f94f;': '🥏',
'&#x1f950;': '🥐',
'&#x1f951;': '🥑',
'&#x1f952;': '🥒',
'&#x1f953;': '🥓',
'&#x1f954;': '🥔',
'&#x1f955;': '🥕',
'&#x1f956;': '🥖',
'&#x1f957;': '🥗',
'&#x1f958;': '🥘',
'&#x1f959;': '🥙',
'&#x1f95a;': '🥚',
'&#x1f95b;': '🥛',
'&#x1f95c;': '🥜',
'&#x1f95d;': '🥝',
'&#x1f95e;': '🥞',
'&#x1f95f;': '🥟',
'&#x1f960;': '🥠',
'&#x1f961;': '🥡',
'&#x1f962;': '🥢',
'&#x1f963;': '🥣',
'&#x1f964;': '🥤',
'&#x1f965;': '🥥',
'&#x1f966;': '🥦',
'&#x1f967;': '🥧',
'&#x1f968;': '🥨',
'&#x1f969;': '🥩',
'&#x1f96a;': '🥪',
'&#x1f96b;': '🥫',
'&#x1f96c;': '🥬',
'&#x1f96d;': '🥭',
'&#x1f96e;': '🥮',
'&#x1f96f;': '🥯',
'&#x1f970;': '🥰',
'&#x1f971;': '🥱',
'&#x1f972;': '🥲',
'&#x1f973;': '🥳',
'&#x1f974;': '🥴',
'&#x1f975;': '🥵',
'&#x1f976;': '🥶',
'&#x1f977;': '🥷',
'&#x1f978;': '🥸',
'&#x1f979;': '🥹',
'&#x1f97a;': '🥺',
'&#x1f97b;': '🥻',
'&#x1f97c;': '🥼',
'&#x1f97d;': '🥽',
'&#x1f97e;': '🥾',
'&#x1f97f;': '🥿',
'&#x1f980;': '🦀',
'&#x1f981;': '🦁',
'&#x1f982;': '🦂',
'&#x1f983;': '🦃',
'&#x1f984;': '🦄',
'&#x1f985;': '🦅',
'&#x1f986;': '🦆',
'&#x1f987;': '🦇',
'&#x1f988;': '🦈',
'&#x1f989;': '🦉',
'&#x1f98a;': '🦊',
'&#x1f98b;': '🦋',
'&#x1f98c;': '🦌',
'&#x1f98d;': '🦍',
'&#x1f98e;': '🦎',
'&#x1f98f;': '🦏',
'&#x1f990;': '🦐',
'&#x1f991;': '🦑',
'&#x1f992;': '🦒',
'&#x1f993;': '🦓',
'&#x1f994;': '🦔',
'&#x1f995;': '🦕',
'&#x1f996;': '🦖',
'&#x1f997;': '🦗',
'&#x1f998;': '🦘',
'&#x1f999;': '🦙',
'&#x1f99a;': '🦚',
'&#x1f99b;': '🦛',
'&#x1f99c;': '🦜',
'&#x1f99d;': '🦝',
'&#x1f99e;': '🦞',
'&#x1f99f;': '🦟',
'&#x1f9a0;': '🦠',
'&#x1f9a1;': '🦡',
'&#x1f9a2;': '🦢',
'&#x1f9a3;': '🦣',
'&#x1f9a4;': '🦤',
'&#x1f9a5;': '🦥',
'&#x1f9a6;': '🦦',
'&#x1f9a7;': '🦧',
'&#x1f9a8;': '🦨',
'&#x1f9a9;': '🦩',
'&#x1f9aa;': '🦪',
'&#x1f9ab;': '🦫',
'&#x1f9ac;': '🦬',
'&#x1f9ad;': '🦭',
'&#x1f9ae;': '🦮',
'&#x1f9af;': '🦯',
'&#x1f9b0;': '🦰',
'&#x1f9b1;': '🦱',
'&#x1f9b2;': '🦲',
'&#x1f9b3;': '🦳',
'&#x1f9b4;': '🦴',
'&#x1f9b5;': '🦵',
'&#x1f9b6;': '🦶',
'&#x1f9b7;': '🦷',
'&#x1f9b8;': '🦸',
'&#x1f9b9;': '🦹',
'&#x1f9ba;': '🦺',
'&#x1f9bb;': '🦻',
'&#x1f9bc;': '🦼',
'&#x1f9bd;': '🦽',
'&#x1f9be;': '🦾',
'&#x1f9bf;': '🦿',
'&#x1f9c0;': '🧀',
'&#x1f9c1;': '🧁',
'&#x1f9c2;': '🧂',
'&#x1f9c3;': '🧃',
'&#x1f9c4;': '🧄',
'&#x1f9c5;': '🧅',
'&#x1f9c6;': '🧆',
'&#x1f9c7;': '🧇',
'&#x1f9c8;': '🧈',
'&#x1f9c9;': '🧉',
'&#x1f9ca;': '🧊',
'&#x1f9cb;': '🧋',
'&#x1f9cc;': '🧌',
'&#x1f9cd;': '🧍',
'&#x1f9ce;': '🧎',
'&#x1f9cf;': '🧏',
'&#x1f9d0;': '🧐',
'&#x1f9d1;': '🧑',
'&#x1f9d2;': '🧒',
'&#x1f9d3;': '🧓',
'&#x1f9d4;': '🧔',
'&#x1f9d5;': '🧕',
'&#x1f9d6;': '🧖',
'&#x1f9d7;': '🧗',
'&#x1f9d8;': '🧘',
'&#x1f9d9;': '🧙',
'&#x1f9da;': '🧚',
'&#x1f9db;': '🧛',
'&#x1f9dc;': '🧜',
'&#x1f9dd;': '🧝',
'&#x1f9de;': '🧞',
'&#x1f9df;': '🧟',
'&#x1f9e0;': '🧠',
'&#x1f9e1;': '🧡',
'&#x1f9e2;': '🧢',
'&#x1f9e3;': '🧣',
'&#x1f9e4;': '🧤',
'&#x1f9e5;': '🧥',
'&#x1f9e6;': '🧦',
'&#x1f9e7;': '🧧',
'&#x1f9e8;': '🧨',
'&#x1f9e9;': '🧩',
'&#x1f9ea;': '🧪',
'&#x1f9eb;': '🧫',
'&#x1f9ec;': '🧬',
'&#x1f9ed;': '🧭',
'&#x1f9ee;': '🧮',
'&#x1f9ef;': '🧯',
'&#x1f9f0;': '🧰',
'&#x1f9f1;': '🧱',
'&#x1f9f2;': '🧲',
'&#x1f9f3;': '🧳',
'&#x1f9f4;': '🧴',
'&#x1f9f5;': '🧵',
'&#x1f9f6;': '🧶',
'&#x1f9f7;': '🧷',
'&#x1f9f8;': '🧸',
'&#x1f9f9;': '🧹',
'&#x1f9fa;': '🧺',
'&#x1f9fb;': '🧻',
'&#x1f9fc;': '🧼',
'&#x1f9fd;': '🧽',
'&#x1f9fe;': '🧾',
'&#x1f9ff;': '🧿',
'&#x1fa70;': '🩰',
'&#x1fa71;': '🩱',
'&#x1fa72;': '🩲',
'&#x1fa73;': '🩳',
'&#x1fa74;': '🩴',
'&#x1fa78;': '🩸',
'&#x1fa79;': '🩹',
'&#x1fa7a;': '🩺',
'&#x1fa80;': '🪀',
'&#x1fa81;': '🪁',
'&#x1fa82;': '🪂',
'&#x1fa83;': '🪃',
'&#x1fa84;': '🪄',
'&#x1fa85;': '🪅',
'&#x1fa86;': '🪆',
'&#x1fa90;': '🪐',
'&#x1fa91;': '🪑',
'&#x1fa92;': '🪒',
'&#x1fa93;': '🪓',
'&#x1fa94;': '🪔',
'&#x1fa95;': '🪕',
'&#x1fa96;': '🪖',
'&#x1fa97;': '🪗',
'&#x1fa98;': '🪘',
'&#x1fa99;': '🪙',
'&#x1fa9a;': '🪚',
'&#x1fa9b;': '🪛',
'&#x1fa9c;': '🪜',
'&#x1fa9d;': '🪝',
'&#x1fa9e;': '🪞',
'&#x1fa9f;': '🪟',
'&#x1faa0;': '🪠',
'&#x1faa1;': '🪡',
'&#x1faa2;': '🪢',
'&#x1faa3;': '🪣',
'&#x1faa4;': '🪤',
'&#x1faa5;': '🪥',
'&#x1faa6;': '🪦',
'&#x1faa7;': '🪧',
'&#x1faa8;': '🪨',
'&#x1fab0;': '🪰',
'&#x1fab1;': '🪱',
'&#x1fab2;': '🪲',
'&#x1fab3;': '🪳',
'&#x1fab4;': '🪴',
'&#x1fab5;': '🪵',
'&#x1fab6;': '🪶',
'&#x1fac0;': '🫀',
'&#x1fac1;': '🫁',
'&#x1fac2;': '🫂',
'&#x1fad0;': '🫐',
'&#x1fad1;': '🫑',
'&#x1fad2;': '🫒',
'&#x1fad3;': '🫓',
'&#x1fad4;': '🫔',
'&#x1fad5;': '🫕',
'&#x1fad6;': '🫖',
'&#x1fae0;': '🫠',
'&#x1fae1;': '🫡',
'&#x1fae2;': '🫢',
'&#x1fae3;': '🫣',
'&#x1fae4;': '🫤',
'&#x1fae5;': '🫥',
'&#x1fae6;': '🫦',
'&#x1fae7;': '🫧',
'&#x1faf0;': '🫰',
'&#x1faf1;': '🫱',
'&#x1faf2;': '🫲',
'&#x1faf3;': '🫳',
'&#x1faf4;': '🫴',
'&#x1faf5;': '🫵',
'&#x1faf6;': '🫶',
'&#x203c;': '‼',
'&#x2049;': '⁉',
'&#x2122;': '™',
'&#x2139;': '',
'&#x2194;': '↔',
'&#x2195;': '↕',
'&#x2196;': '↖',
'&#x2197;': '↗',
'&#x2198;': '↘',
'&#x2199;': '↙',
'&#x21a9;': '↩',
'&#x21aa;': '↪',
'&#x231a;': '⌚',
'&#x231b;': '⌛',
'&#x2328;': '⌨',
'&#x23cf;': '⏏',
'&#x23e9;': '⏩',
'&#x23ea;': '⏪',
'&#x23eb;': '⏫',
'&#x23ec;': '⏬',
'&#x23ed;': '⏭',
'&#x23ee;': '⏮',
'&#x23ef;': '⏯',
'&#x23f0;': '⏰',
'&#x23f1;': '⏱',
'&#x23f2;': '⏲',
'&#x23f3;': '⏳',
'&#x23f8;': '⏸',
'&#x23f9;': '⏹',
'&#x23fa;': '⏺',
'&#x24c2;': 'Ⓜ',
'&#x25aa;': '▪',
'&#x25ab;': '▫',
'&#x25b6;': '▶',
'&#x25c0;': '◀',
'&#x25fb;': '◻',
'&#x25fc;': '◼',
'&#x25fd;': '◽',
'&#x25fe;': '◾',
'&#x2600;': '☀',
'&#x2601;': '☁',
'&#x2602;': '☂',
'&#x2603;': '☃',
'&#x2604;': '☄',
'&#x260e;': '☎',
'&#x2611;': '☑',
'&#x2614;': '☔',
'&#x2615;': '☕',
'&#x2618;': '☘',
'&#x261d;': '☝',
'&#x2620;': '☠',
'&#x2622;': '☢',
'&#x2623;': '☣',
'&#x2626;': '☦',
'&#x262a;': '☪',
'&#x262e;': '☮',
'&#x262f;': '☯',
'&#x2638;': '☸',
'&#x2639;': '☹',
'&#x263a;': '☺',
'&#x2640;': '♀',
'&#x2642;': '♂',
'&#x2648;': '♈',
'&#x2649;': '♉',
'&#x264a;': '♊',
'&#x264b;': '♋',
'&#x264c;': '♌',
'&#x264d;': '♍',
'&#x264e;': '♎',
'&#x264f;': '♏',
'&#x2650;': '♐',
'&#x2651;': '♑',
'&#x2652;': '♒',
'&#x2653;': '♓',
'&#x265f;': '♟',
'&#x2660;': '♠',
'&#x2663;': '♣',
'&#x2665;': '♥',
'&#x2666;': '♦',
'&#x2668;': '♨',
'&#x267b;': '♻',
'&#x267e;': '♾',
'&#x267f;': '♿',
'&#x2692;': '⚒',
'&#x2693;': '⚓',
'&#x2694;': '⚔',
'&#x2695;': '⚕',
'&#x2696;': '⚖',
'&#x2697;': '⚗',
'&#x2699;': '⚙',
'&#x269b;': '⚛',
'&#x269c;': '⚜',
'&#x26a0;': '⚠',
'&#x26a1;': '⚡',
'&#x26aa;': '⚪',
'&#x26ab;': '⚫',
'&#x26b0;': '⚰',
'&#x26b1;': '⚱',
'&#x26bd;': '⚽',
'&#x26be;': '⚾',
'&#x26c4;': '⛄',
'&#x26c5;': '⛅',
'&#x26c8;': '⛈',
'&#x26ce;': '⛎',
'&#x26cf;': '⛏',
'&#x26d1;': '⛑',
'&#x26d3;': '⛓',
'&#x26d4;': '⛔',
'&#x26e9;': '⛩',
'&#x26ea;': '⛪',
'&#x26f0;': '⛰',
'&#x26f1;': '⛱',
'&#x26f2;': '⛲',
'&#x26f3;': '⛳',
'&#x26f4;': '⛴',
'&#x26f5;': '⛵',
'&#x26f7;': '⛷',
'&#x26f8;': '⛸',
'&#x26f9;': '⛹',
'&#x26fa;': '⛺',
'&#x26fd;': '⛽',
'&#x2702;': '✂',
'&#x2705;': '✅',
'&#x2708;': '✈',
'&#x2709;': '✉',
'&#x270a;': '✊',
'&#x270b;': '✋',
'&#x270c;': '✌',
'&#x270d;': '✍',
'&#x270f;': '✏',
'&#x2712;': '✒',
'&#x2714;': '✔',
'&#x2716;': '✖',
'&#x271d;': '✝',
'&#x2721;': '✡',
'&#x2728;': '✨',
'&#x2733;': '✳',
'&#x2734;': '✴',
'&#x2744;': '❄',
'&#x2747;': '❇',
'&#x274c;': '❌',
'&#x274e;': '❎',
'&#x2753;': '❓',
'&#x2754;': '❔',
'&#x2755;': '❕',
'&#x2757;': '❗',
'&#x2763;': '❣',
'&#x2764;': '❤',
'&#x2795;': '',
'&#x2796;': '',
'&#x2797;': '➗',
'&#x27a1;': '➡',
'&#x27b0;': '➰',
'&#x27bf;': '➿',
'&#x2934;': '⤴',
'&#x2935;': '⤵',
'&#x2b05;': '⬅',
'&#x2b06;': '⬆',
'&#x2b07;': '⬇',
'&#x2b1b;': '⬛',
'&#x2b1c;': '⬜',
'&#x2b50;': '⭐',
'&#x2b55;': '⭕',
'&#x3030;': '〰',
'&#x303d;': '〽',
'&#x3297;': '㊗',
'&#x3299;': '㊙',
'&#xe50a;': '󠁪',
'&#xfe0f;': ''
};
// Function to convert HTML entities to Unicode
function decodeHtmlEntities(text) {
let result = text;
// First handle numeric entities (both decimal and hex)
result = result.replace(/&#x([0-9a-fA-F]+);/g, (match, hex) => {
const codePoint = parseInt(hex, 16);
return String.fromCodePoint(codePoint);
});
result = result.replace(/&#(\d+);/g, (match, decimal) => {
const codePoint = parseInt(decimal, 10);
return String.fromCodePoint(codePoint);
});
// Then handle named entities
for (const [entity, unicode] of Object.entries(htmlEntities)) {
result = result.replace(new RegExp(entity.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), 'g'), unicode);
}
return result;
}
// Function to convert WordPress caption shortcodes to Markdown
function convertWordPressCaption(content) {
// Pattern to match WordPress caption shortcode with markdown image inside
const captionPattern = /\[caption[^\]]*\](!\[[^\]]*\]\([^)]+\))([^[\]]*)\[\/caption\]/gi;
return content.replace(captionPattern, (match, imgMarkdown, caption) => {
const cleanCaption = caption.trim();
if (cleanCaption) {
return `${imgMarkdown}\n*${cleanCaption}*`;
} else {
return imgMarkdown;
}
});
}
// Function to convert WordPress image URLs to Astro asset paths
function convertWordPressUrlToAssetPath(url) {
// Pattern to match WordPress upload URLs
const wpUploadPattern = /https?:\/\/[^\/]+\/wp-content\/uploads\/(\d{4})\/(\d{2})\/(.+)/;
const match = url.match(wpUploadPattern);
if (match) {
const [, year, month, filename] = match;
return `~/assets/images/${year}/${month}/${filename}`;
}
// If it's already an asset path, return as is
if (url.startsWith('~/assets/images/')) {
return url;
}
// If it's a relative path, convert to asset path
if (url.startsWith('/assets/images/')) {
return `~${url}`;
}
// For other cases, return as is
return url;
}
// Function to find existing image files
async function findExistingImages(assetsDir) {
const imageMap = new Map();
async function scanDirectory(dir) {
try {
const entries = await readdir(dir);
for (const entry of entries) {
const fullPath = path.join(dir, entry);
const stats = await stat(fullPath);
if (stats.isDirectory()) {
await scanDirectory(fullPath);
} else if (stats.isFile() && /\.(jpg|jpeg|png|gif|svg|webp)$/i.test(entry)) {
const relativePath = path.relative(assetsDir, fullPath);
const assetPath = `~/assets/images/${relativePath.replace(/\\/g, '/')}`;
imageMap.set(entry.toLowerCase(), assetPath);
// Also map without extension for flexible matching
const nameWithoutExt = entry.replace(/\.[^.]+$/, '').toLowerCase();
if (!imageMap.has(nameWithoutExt)) {
imageMap.set(nameWithoutExt, assetPath);
}
}
}
} catch (error) {
// Directory might not exist, continue
}
}
await scanDirectory(assetsDir);
return imageMap;
}
// Function to process a single markdown file
async function processMarkdownFile(filePath, logger, imageMap) {
try {
const content = await readFile(filePath, 'utf-8');
const originalContent = content;
let processedContent = content;
let changes = [];
// 1. Convert HTML entities to Unicode
const entitiesConverted = decodeHtmlEntities(processedContent);
if (entitiesConverted !== processedContent) {
changes.push('HTML entities converted to Unicode');
processedContent = entitiesConverted;
}
// 2. Convert WordPress caption shortcodes
const captionsConverted = convertWordPressCaption(processedContent);
if (captionsConverted !== processedContent) {
changes.push('WordPress caption shortcodes converted to Markdown');
processedContent = captionsConverted;
}
// 3. Convert WordPress image URLs to Astro asset paths
const imageUrlPattern = /https?:\/\/[^\/]+\/wp-content\/uploads\/\d{4}\/\d{2}\/[^\s)]+\.(jpg|jpeg|png|gif|svg|webp)/gi;
const imageUrlsConverted = processedContent.replace(imageUrlPattern, (match) => {
changes.push(`WordPress image URL converted: ${match}`);
return convertWordPressUrlToAssetPath(match);
});
if (imageUrlsConverted !== processedContent) {
processedContent = imageUrlsConverted;
}
// 4. Fix any broken image references by matching with existing files
const imageRefPattern = /!\[([^\]]*)\]\(([^)]+)\)/g;
processedContent = processedContent.replace(imageRefPattern, (match, alt, src) => {
// If it's already a proper asset path, leave it alone
if (src.startsWith('~/assets/images/')) {
return match;
}
// Try to find the image in our map
const filename = path.basename(src).toLowerCase();
const nameWithoutExt = filename.replace(/\.[^.]+$/, '');
if (imageMap.has(filename)) {
changes.push(`Image reference fixed: ${src} -> ${imageMap.get(filename)}`);
return `![${alt}](${imageMap.get(filename)})`;
} else if (imageMap.has(nameWithoutExt)) {
changes.push(`Image reference fixed: ${src} -> ${imageMap.get(nameWithoutExt)}`);
return `![${alt}](${imageMap.get(nameWithoutExt)})`;
}
return match;
});
// Only write file if there were changes
if (processedContent !== originalContent) {
await writeFile(filePath, processedContent, 'utf-8');
logger.log('info', `Processed file with changes: ${changes.join(', ')}`, filePath);
return { processed: true, changes };
} else {
logger.log('info', 'No changes needed', filePath);
return { processed: false, changes: [] };
}
} catch (error) {
logger.log('error', `Error processing file: ${error.message}`, filePath);
return { processed: false, changes: [], error: error.message };
}
}
// Function to create backup of posts
async function createBackup(postsDir, backupDir) {
try {
// Create backup directory if it doesn't exist
if (!fs.existsSync(backupDir)) {
fs.mkdirSync(backupDir, { recursive: true });
}
const files = await readdir(postsDir);
let backupCount = 0;
for (const file of files) {
if (file.endsWith('.md') || file.endsWith('.mdx')) {
const sourcePath = path.join(postsDir, file);
const backupPath = path.join(backupDir, file);
const content = await readFile(sourcePath, 'utf-8');
await writeFile(backupPath, content, 'utf-8');
backupCount++;
}
}
return backupCount;
} catch (error) {
throw new Error(`Failed to create backup: ${error.message}`);
}
}
// Main function
async function main() {
const logger = new Logger(config.logFile);
logger.log('info', 'Starting blog post processing...');
try {
// Create backup
logger.log('info', 'Creating backup of blog posts...');
const backupCount = await createBackup(config.postsDirectory, config.backupDirectory);
logger.log('info', `Backup created: ${backupCount} files backed up to ${config.backupDirectory}`);
// Scan for existing images
logger.log('info', 'Scanning for existing images...');
const imageMap = await findExistingImages(config.assetsDirectory);
logger.log('info', `Found ${imageMap.size} images in assets directory`);
// Process all markdown files
logger.log('info', 'Processing markdown files...');
const files = await readdir(config.postsDirectory);
const markdownFiles = files.filter(file => file.endsWith('.md') || file.endsWith('.mdx'));
let processedCount = 0;
let changedCount = 0;
let errorCount = 0;
const allChanges = [];
for (const file of markdownFiles) {
const filePath = path.join(config.postsDirectory, file);
const result = await processMarkdownFile(filePath, logger, imageMap);
processedCount++;
if (result.error) {
errorCount++;
} else if (result.processed) {
changedCount++;
allChanges.push({ file, changes: result.changes });
}
}
// Summary
logger.log('info', `Processing complete:`);
logger.log('info', ` - Total files processed: ${processedCount}`);
logger.log('info', ` - Files with changes: ${changedCount}`);
logger.log('info', ` - Files with errors: ${errorCount}`);
logger.log('info', ` - Files unchanged: ${processedCount - changedCount - errorCount}`);
if (allChanges.length > 0) {
logger.log('info', '\nSummary of changes:');
allChanges.forEach(({ file, changes }) => {
logger.log('info', ` ${file}:`);
changes.forEach(change => {
logger.log('info', ` - ${change}`);
});
});
}
// Save logs
await logger.saveLogs();
console.log('\n✅ Blog post processing completed successfully!');
console.log(`📄 Check ${config.logFile} for detailed logs`);
console.log(`💾 Backup created in ${config.backupDirectory}`);
} catch (error) {
logger.log('error', `Fatal error: ${error.message}`);
await logger.saveLogs();
console.error('❌ Processing failed:', error.message);
process.exit(1);
}
}
// Run the script
if (require.main === module) {
main().catch(console.error);
}
module.exports = {
decodeHtmlEntities,
convertWordPressCaption,
convertWordPressUrlToAssetPath,
findExistingImages,
processMarkdownFile,
createBackup
};