From a14213151f8dd810dde64ee9a372bd98f9e3ca87 Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Sat, 14 Mar 2026 17:45:05 -0700 Subject: [PATCH] Extract per-menu schedule in extract_page mode - Claude prompt now asks for menuSchedule (days/times this menu is served) - Separates menu schedule from overall business hours - Returns menuSchedule in response for frontend to use Co-Authored-By: Claude Opus 4.6 --- api/setup/analyzeMenuUrl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/setup/analyzeMenuUrl.php b/api/setup/analyzeMenuUrl.php index 7f0c222..62d14e7 100644 --- a/api/setup/analyzeMenuUrl.php +++ b/api/setup/analyzeMenuUrl.php @@ -245,7 +245,7 @@ try { } // Send to Claude for this single menu page - $singlePrompt = 'You are an expert at extracting structured menu data from restaurant website HTML. Extract ALL menu items visible in the HTML. Return valid JSON with these keys: business (object with name, address, phone, hours, brandColor), categories (array of category name strings), items (array of objects with name, description, price, category, imageUrl). CATEGORIES vs ITEMS (CRITICAL): A CATEGORY is a broad section heading that groups items. An ITEM is an individual food/drink with name, description, and price. Each item must have a \'category\' field. For prices: numbers (e.g., 12.99). For imageUrl: the full src URL of the food image from the HTML. For brandColor: suggest a vibrant hex (6 digits, no hash). Return ONLY valid JSON.'; + $singlePrompt = 'You are an expert at extracting structured menu data from restaurant website HTML. Extract ALL menu items visible in the HTML. Return valid JSON with these keys: business (object with name, address, phone, hours, brandColor), menuSchedule (string — the days/times THIS specific menu is served, e.g. "Mon-Fri 11am-3pm" or "Sat-Sun 10am-2pm"), categories (array of category name strings), items (array of objects with name, description, price, category, imageUrl). MENU SCHEDULE: Look for text indicating when this menu is available — phrases like "Served Mon-Fri 11am-3pm", "Available weekends", "Daily 5pm-10pm", etc. Put this in menuSchedule. The business hours field is for the restaurant\'s OVERALL operating hours (if visible). CATEGORIES vs ITEMS (CRITICAL): A CATEGORY is a broad section heading that groups items. An ITEM is an individual food/drink with name, description, and price. Each item must have a \'category\' field. For prices: numbers (e.g., 12.99). For imageUrl: the full src URL of the food image from the HTML. For brandColor: suggest a vibrant hex (6 digits, no hash). Return ONLY valid JSON.'; $msgContent = []; foreach (array_slice($imgContent, 0, 5) as $ic) { @@ -317,6 +317,7 @@ try { 'OK' => true, 'mode' => 'extract_page', 'menuName' => $menuName, + 'menuSchedule' => $menuData['menuSchedule'] ?? '', 'url' => $singleUrl, 'DATA' => [ 'business' => $menuData['business'] ?? [],