Refresh instances list

This commit is contained in:
Lim Chee Aun 2023-08-22 20:11:28 +08:00
parent aede10d71e
commit e88b24fe6f
2 changed files with 541 additions and 523 deletions

View file

@ -17,8 +17,18 @@ const results = await fetch(url, {
});
const json = await results.json();
// Filters
json.instances = json.instances.filter(
(instance) => Number(instance.connections) > 20,
);
const names = json.instances.map((instance) => instance.name);
// Write to file
const path = './src/data/instances.json';
fs.writeFileSync(path, JSON.stringify(names, null, '\t'), 'utf8');
// Write everything to file, for debugging
const path2 = './src/data/instances-full.json';
fs.writeFileSync(path2, JSON.stringify(json, null, '\t'), 'utf8');

File diff suppressed because it is too large Load diff