web/utils/explorer.js

19 lines
501 B
JavaScript
Raw Permalink Normal View History

2024-01-25 18:44:10 +01:00
const resp = await fetch("https://explorer-data.web3privacy.info/");
const data = await resp.json();
2024-01-31 01:57:12 +01:00
const respContribs = await fetch(
`https://api.github.com/repos/web3privacy/explorer-data/contributors`,
);
2024-01-25 18:49:03 +01:00
const respContribsData = await respContribs.json();
2024-01-25 18:44:10 +01:00
const explorer = {
2024-01-31 01:57:12 +01:00
projects: data.projects.length,
contributors: respContribsData.length,
};
2024-01-25 18:44:10 +01:00
2024-01-31 01:57:12 +01:00
await Deno.writeTextFile(
"./src/explorer.json",
JSON.stringify(explorer, null, 2),
);
console.log(`File ./src/explorer.json saved`);