Curated Geo country file, improved hint letter spacing.

This commit is contained in:
Niels Simenon
2022-11-02 22:20:36 +01:00
parent 157ae8bfcc
commit c1b8340268
4 changed files with 1280 additions and 15 deletions

View File

@@ -985,7 +985,8 @@
"file": "174f.png",
"code": 760,
"alpha2": "SY",
"name": "Syrian Arab Republic"
"name": "Syria",
"fullName": "Syrian Arab Republic"
},
{
"file": "715f.png",

View File

@@ -2,9 +2,25 @@
const fs = require('fs').promises;
const crypto = require('crypto');
// const bhttp = require('bhttp');
const countries = require('./countries.json');
/*
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 countryImgs = await fs.readdir('./assets/countries');
const countriesByCode = Object.fromEntries(countries.map((country) => [country.alpha2, country]));
@@ -28,3 +44,4 @@ async function init() {
}
init();
// fetchCountries();

File diff suppressed because one or more lines are too long