mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-21 16:55:25 +03:00
Refresh instances list
This commit is contained in:
parent
aede10d71e
commit
e88b24fe6f
2 changed files with 541 additions and 523 deletions
|
@ -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
Loading…
Reference in a new issue