From d8e6f619acce078548944ea108a1fff8f58558fa Mon Sep 17 00:00:00 2001 From: John Mizerek Date: Fri, 13 Feb 2026 08:53:25 -0800 Subject: [PATCH] Parse Toast menu from visible HTML for complete item extraction - Extract items from visible HTML instead of just __OO_STATE__ JSON - Parse headerText spans for item names, price spans for prices - Extract images from Menu_files/ src attributes - Fall back to simpler headerText matching if block parsing fails - Also extract images from __OO_STATE__ and match to items by name - Fixes issue where only 116 items extracted instead of 163+ Co-Authored-By: Claude Opus 4.5 --- api/setup/analyzeMenuUrl.cfm | 242 ++++++++++++++++++++++------------- 1 file changed, 155 insertions(+), 87 deletions(-) diff --git a/api/setup/analyzeMenuUrl.cfm b/api/setup/analyzeMenuUrl.cfm index 07e649e..99c79d8 100644 --- a/api/setup/analyzeMenuUrl.cfm +++ b/api/setup/analyzeMenuUrl.cfm @@ -68,107 +68,175 @@ - - - + + + - - - - - + + + + + + + + + - - - + + ]*class="[^"]*groupHeader[^"]*"[^>]*>([^<]+)', pageHtml)> + + ([^<]+).*', '\1')> + + + + + + - - - - - - + + + ]*class="[^"]*item[^"]*"[^>]*>.*?', pageHtml)> + - - - - - - - - - - + + + ([^<]+)', block)> + + ([^<]+).*', '\1')> + - - - - - - - - + + + - - - - - - - - + + + + - - - - - - - - - - - - - + + ]*class="price"[^>]*>\$?([0-9.]+)', block)> + + \\$?([0-9.]+).*', '\1')> + + + + - - - + + ]*class="[^"]*description[^"]*"[^>]*>([^<]+)', block)> + + ([^<]+).*', '\1'))> + + + + + + + + + + + + + + + + + + + + + + + + + + ([^<]+)', pageHtml)> + + ([^<]+).*', '\1')> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + - + - - - - - - - - - #serializeJSON(response)# - + + + + + + + + + #serializeJSON(response)# + - - - - - + + + +