Skip to content

Instantly share code, notes, and snippets.

@stepney141
Last active August 19, 2024 14:03
Show Gist options
  • Save stepney141/8d3f194c15122f0134cb87b2b10708f8 to your computer and use it in GitHub Desktop.
Save stepney141/8d3f194c15122f0134cb87b2b10708f8 to your computer and use it in GitHub Desktop.
bookmeter_wish samples
const mode = parseArgv(process.argv);
const users = [
{ id: "1504793", name: "Azaika" },
{ id: "1504772", name: "qraphnet" },
{ id: "1504804", name: "caphosra" },
{ id: "1504818", name: "Juei" },
{ id: "1504820", name: "LLUUIIGGEE" },
{ id: "1503969", name: "ゆみや" },
{ id: "1504789", name: "hakatashi" }
];
for (const u of users) {
await main({
mode,
userId: u.id,
doLogin: false,
outputFilePath: {
wish: `./csv/tsg/${u.name}.csv`,
stacked: `./csv/tsg/${u.name}_stacked.csv`
}
});
await sleep(60 * 1000);
}
const mode = parseArgv(process.argv);
const browser = await puppeteer.launch({
defaultViewport: { width: 1000, height: 1000 },
headless: false,
slowMo: 15
});
const bkmt = await new Bookmaker(browser, BOOKMETER_DEFAULT_USER_ID).login();
const targetBooks = await readUrlList("./toda-s141.txt");
for (const url of targetBooks!) {
const bookInfo = await bkmt.scanEachBook(url, { register: true, mode });
console.log(bookInfo);
await sleep(60 * 1000);
}
await browser.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment