#14 共通のサムネとタイトルの取得は完成

This commit is contained in:
2025-06-04 01:17:43 +09:00
parent 0afba7f345
commit 7719a9ea9d
8 changed files with 1221 additions and 26 deletions
+1102
View File
File diff suppressed because it is too large Load Diff
+15
View File
@@ -0,0 +1,15 @@
{
"name": "lib",
"version": "1.0.0",
"main": "screenshot.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"puppeteer": "^24.10.0"
}
}
+18
View File
@@ -0,0 +1,18 @@
const puppeteer = require ('puppeteer')
const fs = require ('fs')
void (async () => {
const url = process.argv[2]
const output = process.argv[3]
const browser = await puppeteer.launch ({
args: ['--no-sandbox', '--disable-setuid-sandbox'] })
const page = await browser.newPage ()
await page.setViewport ({ width: 960, height: 960 })
await page.goto (url, { waitUntil: 'networkidle2', timeout: 10000 })
await page.screenshot ({ path: output })
await browser.close ()
}) ()