From 0cd5fb770ca9bd3f304d9556a4b33a4ad4f45e7e Mon Sep 17 00:00:00 2001
From: yyamashita <yyamashita@mosquit.one>
Date: Thu, 7 May 2026 10:16:43 +0900
Subject: Playwright scraping for FLAT/Pitbar; web UI display-only

- Install Playwright + Chromium; add shared browser singleton (playwright.server.ts)
- Rewrite flat-nishiogikubo scraper: Wix calendar via headless browser,
  month navigation via date picker, extracts .WPczEB/.ExCBIq selectors
- Rewrite pitbar-nishiogikubo scraper: freecalend.com via headless browser,
  parses cal-{member}-{year}-{month}-{day} cell IDs
- scraper-runner: close shared browser after each run with closeBrowser()
- Remove all scrape trigger buttons from web UI (events index, venues page);
  remove /api/scrape and /api/scrape-status from routes.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---
 app/routes/events._index.tsx | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

(limited to 'app/routes/events._index.tsx')

diff --git a/app/routes/events._index.tsx b/app/routes/events._index.tsx
index 3ff441a..1917ace 100644
--- a/app/routes/events._index.tsx
+++ b/app/routes/events._index.tsx
@@ -1,4 +1,4 @@
-import { useLoaderData, useSearchParams, Form, Link } from "react-router";
+import { useLoaderData, useSearchParams, Link } from "react-router";
 import type { Route } from "./+types/events._index";
 import { queryEvents, getVenues } from "~/lib/db.server";
 import EventCard from "~/components/EventCard";
@@ -49,16 +49,8 @@ export default function EventsIndex() {
       </header>
 
       <main className="max-w-6xl mx-auto px-4 py-8">
-        <div className="mb-6 flex items-center justify-between">
+        <div className="mb-6">
           <h1 className="text-2xl font-bold">イベント一覧</h1>
-          <Form method="post" action="/api/scrape">
-            <button
-              type="submit"
-              className="rounded-md bg-indigo-600 px-4 py-2 text-sm font-medium hover:bg-indigo-500 transition-colors"
-            >
-              情報を更新
-            </button>
-          </Form>
         </div>
 
         <FilterBar venues={venues} defaultDateFrom={date_from} defaultDateTo={date_to} />
@@ -66,7 +58,7 @@ export default function EventsIndex() {
         {events.length === 0 ? (
           <div className="mt-16 text-center text-gray-500">
             <p className="text-lg">イベントが見つかりません</p>
-            <p className="mt-2 text-sm">「情報を更新」ボタンでデータを取得してください。</p>
+            <p className="mt-2 text-sm">スクレイパーを実行してデータを取得してください: <code>npm run scrape</code></p>
           </div>
         ) : (
           <div className="mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
-- 
cgit v1.2.3

