Refresh instances list

pull/206/head
Lim Chee Aun 2023-08-22 20:11:28 +08:00
rodzic aede10d71e
commit e88b24fe6f
2 zmienionych plików z 541 dodań i 523 usunięć

Wyświetl plik

@ -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');

Plik diff jest za duży Load Diff