mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 20:28:52 +03:00
12 lines
331 B
JavaScript
12 lines
331 B
JavaScript
import fs from 'fs';
|
|
|
|
const url = 'https://api.joinmastodon.org/servers';
|
|
const results = await fetch(url);
|
|
|
|
const json = await results.json();
|
|
|
|
const domains = json.map((instance) => instance.domain);
|
|
|
|
// Write to file
|
|
const path = './src/data/instances.json';
|
|
fs.writeFileSync(path, JSON.stringify(domains, null, '\t'), 'utf8');
|