SPB Git

spb/search-box Public

Agentic web research engine — hypotheses, verbatim evidence, contradictions, sourced answers streamed live. Claude Opus 5 + Firecrawl + PostgreSQL.

TypeScript 76.9% CSS 18.7% SQL 2.1% JavaScript 1.8% Shell 0.5%
1.2 KB · 36 lines javascript
Raw Blame History
1/**2 * Search-box.ai3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 * File: scripts/screenshots.mjs6 * Description: Captures README screenshots (home, session desktop, session mobile) via Playwright.7 *8 * Usage: node scripts/screenshots.mjs [baseUrl] [sessionId]9 */1011import { chromium } from "playwright";1213const base = process.argv[2] ?? "http://localhost:3000";14const sessionId = process.argv[3] ?? "ses_4OqHdb-YRqwM";1516const browser = await chromium.launch();1718async function shot(url, viewport, out, { settle = 9000, toTop = true } = {}) {19  const page = await browser.newPage({ viewport });20  await page.goto(url, { waitUntil: "networkidle" }).catch(() => {});21  await page.waitForTimeout(settle);22  if (toTop) {23    await page.evaluate(() => window.scrollTo(0, 0));24    await page.waitForTimeout(600);25  }26  await page.screenshot({ path: out });27  await page.close();28  console.log(`captured ${out}`);29}3031await shot(`${base}/`, { width: 1440, height: 860 }, "docs/screenshots/home.png", { settle: 3000 });32await shot(`${base}/r/${sessionId}`, { width: 1440, height: 900 }, "docs/screenshots/session-live.png");33await shot(`${base}/r/${sessionId}`, { width: 390, height: 844 }, "docs/screenshots/mobile.png");3435await browser.close();36