2023-03-07 14:38:06 +00:00
|
|
|
import fs from 'fs';
|
|
|
|
|
2023-12-25 11:25:48 +00:00
|
|
|
fetch('https://lingva.phanpy.social/api/v1/languages/source')
|
2023-03-07 14:38:06 +00:00
|
|
|
.then((response) => response.json())
|
|
|
|
.then((json) => {
|
|
|
|
const file = './src/data/lingva-source-languages.json';
|
|
|
|
console.log(`Writing ${file}...`);
|
|
|
|
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
|
|
|
|
});
|
|
|
|
|
2023-12-25 11:25:48 +00:00
|
|
|
fetch('https://lingva.phanpy.social/api/v1/languages/target')
|
2023-03-07 14:38:06 +00:00
|
|
|
.then((response) => response.json())
|
|
|
|
.then((json) => {
|
|
|
|
const file = './src/data/lingva-target-languages.json';
|
|
|
|
console.log(`Writing ${file}...`);
|
|
|
|
fs.writeFileSync(file, JSON.stringify(json.languages, null, '\t'), 'utf8');
|
|
|
|
});
|