diff --git a/api/setup/analyzeMenuUrl.php b/api/setup/analyzeMenuUrl.php index d60ecb0..0f7c391 100644 --- a/api/setup/analyzeMenuUrl.php +++ b/api/setup/analyzeMenuUrl.php @@ -292,31 +292,6 @@ JSEOF; } $siteName = $bizInfo['name'] ?? ''; - // 3. Extract header image from og:image or JSON-LD image - $headerImageUrl = ''; - // Try og:image meta tag first (most common for restaurants) - if (preg_match('#]*type=["\']application/ld\+json["\'][^>]*>([^<]+)#i', $html, $ldImgMatches)) { - foreach ($ldImgMatches[1] as $ldJson) { - $ld = json_decode($ldJson, true); - if (!is_array($ld)) continue; - $entries = isset($ld['@graph']) ? $ld['@graph'] : [$ld]; - foreach ($entries as $entry) { - if (!empty($entry['image'])) { - $img = $entry['image']; - if (is_string($img)) { $headerImageUrl = $img; break 2; } - if (is_array($img) && !empty($img['url'])) { $headerImageUrl = $img['url']; break 2; } - if (is_array($img) && isset($img[0])) { $headerImageUrl = is_string($img[0]) ? $img[0] : ($img[0]['url'] ?? ''); break 2; } - } - } - } - } - // Parse address into components if only full string if (!empty($bizInfo['address']) && empty($bizInfo['addressLine1'])) { $addr = $bizInfo['address']; @@ -468,7 +443,6 @@ JSEOF; 'platformPages' => $platformPages, 'hasPlatform' => $hasPlatform, 'totalPagesFound' => count($menuPages), - 'headerImageUrl' => $headerImageUrl, ]); }