Compare commits
132 Commits
dda9ba81ae
...
socketio
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59424af388 | ||
|
|
39a27f501e | ||
|
|
ffdfefa6d4 | ||
|
|
b3ab3bf1ba | ||
|
|
2e54d38383 | ||
|
|
98a1aa8fff | ||
|
|
6f2a5e03e9 | ||
|
|
9966c79a26 | ||
|
|
a46ffb431b | ||
|
|
b9be447dba | ||
|
|
a45d00c105 | ||
|
|
00b92f445e | ||
|
|
09e78a8bbb | ||
|
|
44d8304aa0 | ||
|
|
8e16f189f5 | ||
|
|
c85ec3440b | ||
|
|
650a8d2ec9 | ||
|
|
d263c42d38 | ||
|
|
fcd1597707 | ||
|
|
27a82b9cdd | ||
|
|
b791147ce0 | ||
|
|
29ce536ffd | ||
|
|
e584389453 | ||
|
|
ba8e39f857 | ||
|
|
44386cf096 | ||
|
|
21feb37d21 | ||
|
|
85be251b3f | ||
|
|
73117e7614 | ||
|
|
750997f3cc | ||
|
|
da9c85d90c | ||
|
|
ee50935339 | ||
|
|
2860630921 | ||
|
|
6c5fd6ed0a | ||
|
|
c43be9df13 | ||
|
|
8aef44b2d9 | ||
|
|
77b6ebfb5c | ||
|
|
6817f51b83 | ||
|
|
42c850ac90 | ||
|
|
91eaa9d709 | ||
|
|
f4776df853 | ||
|
|
cfcb48224b | ||
|
|
ea672df4c3 | ||
|
|
4fbd366bb9 | ||
|
|
8c34fe5013 | ||
|
|
74342ab07b | ||
|
|
7321037f4f | ||
|
|
68cefc0e2a | ||
|
|
f222922643 | ||
|
|
c4d328b409 | ||
|
|
efc45f2103 | ||
|
|
b724f4ecb7 | ||
|
|
8960a23448 | ||
|
|
ef30c41758 | ||
|
|
4b8077f7e7 | ||
|
|
d4edbfda7a | ||
|
|
ad7f1f548e | ||
|
|
6469a7b660 | ||
|
|
f084dddfce | ||
|
|
a946e0447b | ||
|
|
e5a10d8059 | ||
|
|
291a338eca | ||
|
|
21a90a51cf | ||
|
|
058ca10011 | ||
|
|
8f37ee145e | ||
|
|
834ccc3ea0 | ||
|
|
3a660a0c1c | ||
|
|
c7c0f3de2d | ||
|
|
c17c51dcd1 | ||
|
|
a759421791 | ||
|
|
0aa8475d3a | ||
|
|
ed87ce1759 | ||
|
|
6c3a887f3f | ||
|
|
c22767285c | ||
|
|
9295502d2c | ||
|
|
b77cf1d487 | ||
|
|
174dfdedfa | ||
|
|
50263b2b56 | ||
|
|
87f2e81794 | ||
|
|
761078bf19 | ||
|
|
a13d88ada5 | ||
|
|
3a8d040996 | ||
|
|
d624602a1d | ||
|
|
dac6430112 | ||
|
|
18572df506 | ||
|
|
174eba2b1e | ||
|
|
4727217b88 | ||
|
|
e0aab6acf3 | ||
|
|
cdfcd8e4fa | ||
|
|
a47b8adf99 | ||
|
|
803e44dd84 | ||
|
|
d41a0384d6 | ||
|
|
5499dbf1f1 | ||
|
|
97a76fd88c | ||
|
|
aa5559f286 | ||
|
|
9c1966f600 | ||
|
|
c1b8340268 | ||
|
|
157ae8bfcc | ||
|
|
43d307f68c | ||
|
|
631dc58d3c | ||
|
|
d99503885b | ||
|
|
210155305c | ||
|
|
72aed56485 | ||
|
|
036feb12a5 | ||
|
|
48003e4d34 | ||
|
|
09d069dec1 | ||
|
|
22e5114647 | ||
|
|
baa2246245 | ||
|
|
43478b3cc6 | ||
|
|
46c61e2a92 | ||
|
|
6adb443aff | ||
|
|
53022278c9 | ||
|
|
35a28760cd | ||
|
|
3c42807f62 | ||
|
|
d8e4e4f0a2 | ||
|
|
3e685bd5a4 | ||
|
|
505b2449ba | ||
|
|
2d48a18c16 | ||
|
|
007773f38c | ||
|
|
89dc51e3e9 | ||
|
|
435ff3a4b5 | ||
|
|
c3f1b59416 | ||
|
|
d257f93f3e | ||
|
|
b4add9e11d | ||
|
|
cb2fa362d6 | ||
|
|
02da8f7705 | ||
|
|
273013e390 | ||
|
|
33c7b25bd2 | ||
|
|
8b75691c5f | ||
|
|
6ebe1cf4aa | ||
|
|
dc6df7c344 | ||
|
|
809e79affe | ||
|
|
335bd55a91 |
3
.gitignore
vendored
@@ -1,5 +1,8 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
config/*
|
config/*
|
||||||
!config/default.js
|
!config/default.js
|
||||||
|
*.config.js
|
||||||
|
!ecosystem.config.js
|
||||||
|
*.sqlite
|
||||||
points*.json
|
points*.json
|
||||||
assets/mash-words.json
|
assets/mash-words.json
|
||||||
|
|||||||
1119
assets/countries-curated.json
Normal file
63
assets/countries.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
'use strict';
|
||||||
|
|
||||||
|
const fs = require('fs').promises;
|
||||||
|
const crypto = require('crypto');
|
||||||
|
const { argv } = require('yargs');
|
||||||
|
// const bhttp = require('bhttp');
|
||||||
|
|
||||||
|
const countries = require('./countries.json');
|
||||||
|
const states = require('./states-us.json');
|
||||||
|
|
||||||
|
const data = {
|
||||||
|
countries,
|
||||||
|
states,
|
||||||
|
flags: countries,
|
||||||
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
async function fetchCountries() {
|
||||||
|
const res = await bhttp.get('http://localhost:3000/api/countries');
|
||||||
|
|
||||||
|
if (res.statusCode === 200) {
|
||||||
|
await fs.writeFile('./assets/countries.json', JSON.stringify(res.body, null, 4));
|
||||||
|
console.log('Done fetching countries!');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Failed to fetch countries: ${res.statusCode}`);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
async function init() {
|
||||||
|
const type = argv.type || 'countries';
|
||||||
|
|
||||||
|
const countryImgs = await fs.readdir(`./assets/${type}`);
|
||||||
|
const countriesByCode = Object.fromEntries(data[type].map((country) => [country.alpha2, country]));
|
||||||
|
|
||||||
|
const imgCountries = await Promise.all(countryImgs.filter((file) => !['encoded', 'disabled'].includes(file)).map(async (file) => {
|
||||||
|
const code = file.match(/(\w+).png/)?.[1];
|
||||||
|
|
||||||
|
if (!code || !countriesByCode[code]) {
|
||||||
|
console.warn(`No country for ${file} with code ${code}`);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filename = `${crypto.createHash('md5').update(code).digest('hex').slice(0, 4)}.png`;
|
||||||
|
|
||||||
|
await fs.copyFile(`./assets/${type}/${file}`, `./assets/${type}/encoded/${filename}`);
|
||||||
|
|
||||||
|
return {
|
||||||
|
file: filename,
|
||||||
|
code,
|
||||||
|
...countriesByCode[code],
|
||||||
|
};
|
||||||
|
}));
|
||||||
|
|
||||||
|
await fs.writeFile(`./assets/${type}-curated.json`, JSON.stringify(imgCountries.filter(Boolean), null, 4));
|
||||||
|
|
||||||
|
console.log('Done!');
|
||||||
|
}
|
||||||
|
|
||||||
|
init();
|
||||||
|
// fetchCountries();
|
||||||
1259
assets/countries.json
Normal file
BIN
assets/countries/AD.png
Normal file
|
After Width: | Height: | Size: 252 KiB |
BIN
assets/countries/AE.png
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
assets/countries/AF.png
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
assets/countries/AL.png
Normal file
|
After Width: | Height: | Size: 172 KiB |
BIN
assets/countries/AM.png
Normal file
|
After Width: | Height: | Size: 187 KiB |
BIN
assets/countries/AO.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
assets/countries/AQ.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
assets/countries/AR.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
assets/countries/AS.png
Normal file
|
After Width: | Height: | Size: 300 KiB |
BIN
assets/countries/AT.png
Normal file
|
After Width: | Height: | Size: 164 KiB |
BIN
assets/countries/AU.png
Normal file
|
After Width: | Height: | Size: 88 KiB |
BIN
assets/countries/AZ.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
assets/countries/BA.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
assets/countries/BB.png
Normal file
|
After Width: | Height: | Size: 295 KiB |
BIN
assets/countries/BD.png
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
assets/countries/BE.png
Normal file
|
After Width: | Height: | Size: 181 KiB |
BIN
assets/countries/BF.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
BIN
assets/countries/BG.png
Normal file
|
After Width: | Height: | Size: 174 KiB |
BIN
assets/countries/BH.png
Normal file
|
After Width: | Height: | Size: 13 KiB |
BIN
assets/countries/BI.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
assets/countries/BJ.png
Normal file
|
After Width: | Height: | Size: 142 KiB |
BIN
assets/countries/BO.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
assets/countries/BR.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
assets/countries/BS.png
Normal file
|
After Width: | Height: | Size: 364 KiB |
BIN
assets/countries/BT.png
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
assets/countries/BW.png
Normal file
|
After Width: | Height: | Size: 138 KiB |
BIN
assets/countries/BY.png
Normal file
|
After Width: | Height: | Size: 146 KiB |
BIN
assets/countries/BZ.png
Normal file
|
After Width: | Height: | Size: 262 KiB |
BIN
assets/countries/CA.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
assets/countries/CD.png
Normal file
|
After Width: | Height: | Size: 251 KiB |
BIN
assets/countries/CF.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
assets/countries/CG.png
Normal file
|
After Width: | Height: | Size: 229 KiB |
BIN
assets/countries/CH.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
assets/countries/CI.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
assets/countries/CL.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
assets/countries/CM.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
assets/countries/CN.png
Normal file
|
After Width: | Height: | Size: 357 KiB |
BIN
assets/countries/CO.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
assets/countries/CR.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
assets/countries/CU.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
assets/countries/CY.png
Normal file
|
After Width: | Height: | Size: 225 KiB |
BIN
assets/countries/CZ.png
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
assets/countries/DE.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
assets/countries/DJ.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
assets/countries/DK.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
assets/countries/DO.png
Normal file
|
After Width: | Height: | Size: 107 KiB |
BIN
assets/countries/DZ.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
assets/countries/EC.png
Normal file
|
After Width: | Height: | Size: 77 KiB |
BIN
assets/countries/EE.png
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
assets/countries/EG.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
assets/countries/EH.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
assets/countries/ER.png
Normal file
|
After Width: | Height: | Size: 128 KiB |
BIN
assets/countries/ES.png
Normal file
|
After Width: | Height: | Size: 177 KiB |
BIN
assets/countries/ET.png
Normal file
|
After Width: | Height: | Size: 132 KiB |
BIN
assets/countries/FI.png
Normal file
|
After Width: | Height: | Size: 185 KiB |
BIN
assets/countries/FJ.png
Normal file
|
After Width: | Height: | Size: 101 KiB |
BIN
assets/countries/FK.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
assets/countries/FM.png
Normal file
|
After Width: | Height: | Size: 325 KiB |
BIN
assets/countries/FO.png
Normal file
|
After Width: | Height: | Size: 237 KiB |
BIN
assets/countries/FR.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
assets/countries/GA.png
Normal file
|
After Width: | Height: | Size: 110 KiB |
BIN
assets/countries/GB.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
assets/countries/GE.png
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
assets/countries/GF.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
assets/countries/GH.png
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
assets/countries/GI.png
Normal file
|
After Width: | Height: | Size: 219 KiB |
BIN
assets/countries/GL.png
Normal file
|
After Width: | Height: | Size: 178 KiB |
BIN
assets/countries/GM.png
Normal file
|
After Width: | Height: | Size: 155 KiB |
BIN
assets/countries/GN.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
assets/countries/GQ.png
Normal file
|
After Width: | Height: | Size: 286 KiB |
BIN
assets/countries/GR.png
Normal file
|
After Width: | Height: | Size: 233 KiB |
BIN
assets/countries/GT.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
assets/countries/GW.png
Normal file
|
After Width: | Height: | Size: 226 KiB |
BIN
assets/countries/GY.png
Normal file
|
After Width: | Height: | Size: 92 KiB |
BIN
assets/countries/HN.png
Normal file
|
After Width: | Height: | Size: 104 KiB |
BIN
assets/countries/HR.png
Normal file
|
After Width: | Height: | Size: 443 KiB |
BIN
assets/countries/HT.png
Normal file
|
After Width: | Height: | Size: 103 KiB |
BIN
assets/countries/HU.png
Normal file
|
After Width: | Height: | Size: 231 KiB |
BIN
assets/countries/ID.png
Normal file
|
After Width: | Height: | Size: 105 KiB |
BIN
assets/countries/IE.png
Normal file
|
After Width: | Height: | Size: 174 KiB |
BIN
assets/countries/IL.png
Normal file
|
After Width: | Height: | Size: 175 KiB |
BIN
assets/countries/IM.png
Normal file
|
After Width: | Height: | Size: 262 KiB |
BIN
assets/countries/IN.png
Normal file
|
After Width: | Height: | Size: 114 KiB |
BIN
assets/countries/IQ.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
assets/countries/IR.png
Normal file
|
After Width: | Height: | Size: 171 KiB |
BIN
assets/countries/IS.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
assets/countries/IT.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
assets/countries/JE.png
Normal file
|
After Width: | Height: | Size: 202 KiB |
BIN
assets/countries/JM.png
Normal file
|
After Width: | Height: | Size: 106 KiB |
BIN
assets/countries/JO.png
Normal file
|
After Width: | Height: | Size: 175 KiB |
BIN
assets/countries/JP.png
Normal file
|
After Width: | Height: | Size: 144 KiB |
BIN
assets/countries/KE.png
Normal file
|
After Width: | Height: | Size: 108 KiB |
BIN
assets/countries/KG.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
assets/countries/KH.png
Normal file
|
After Width: | Height: | Size: 427 KiB |
BIN
assets/countries/KP.png
Normal file
|
After Width: | Height: | Size: 128 KiB |