index.js//@ts-check
const fs = require("fs").promises;
const main = async () => {
const pgcountjsonr = await fetch(
"https://scrapbox.io/api/pages/villagepump/?limit=1"
);
const pgcountjson = await pgcountjsonr.json();
const pgcount = pgcountjson["count"];
let pglist = [];
const pglisttempjsonr = await fetch(
`https://scrapbox.io/api/pages/villagepump/?limit=500&skip=${pgcount - 500}`
);
const pglisttempjson = await pglisttempjsonr.json();
pglisttempjson["pages"].forEach((e) => {
pglist.push(" [" + e["title"] + "]");
});
await fs.writeFile("villagepump.txt", pglist.join("\n"));
};
main();
package.json{
"name": "villagepumpsoko",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"start": "node ."
},
"keywords": [],
"author": "bsahd",
"license": "MIT",
"description": "get a **soko of pages** of villagepump."
}