SIMON Master Console Rebuild
True command center for SIMON + WEB360
This rebuild gives you a cleaner production spine: interactive tree, live viewer, guarded editor, dynamic graphics, architecture map, and note storage. It is designed to sit beside your existing
console.php
and become the stronger replacement path.
Dashboard
Tree
Viewer
System Map
File Registry
Notes
Files
15,326
Folders
408
Scanned Size
3.84 GB
PHP Files
886
Editable Text Files
12,587
File viewer
guarded to /htdocs
/live/feed_proxy.php
<?php declare(strict_types=1); require __DIR__ . '/bootstrap.php'; $enrich = isset($_GET['enrich']) || isset($_GET['ai']); $store = isset($_GET['store']); if ($enrich || $store) require_once __DIR__ . '/ai_engine.php'; $start = microtime(true); $feeds = simon_read_json_file(SIMON_FEEDS_FILE, []); if (!is_array($feeds)) $feeds = []; $limit = max(1, min(500, (int)($_GET['limit'] ?? 100))); $category = trim((string)($_GET['category'] ?? '')); $source = trim((string)($_GET['source'] ?? '')); $q = trim((string)($_GET['q'] ?? '')); $lat = isset($_GET['lat']) ? (float)$_GET['lat'] : null; $lon = isset($_GET['lon']) ? (float)$_GET['lon'] : null; $place = trim((string)($_GET['place'] ?? '')); $force = isset($_GET['force']); if ($force) { foreach (glob(SIMON_CACHE_DIR . '/*.json') ?: [] as $file) @unlink($file); } $ctx = ['lat'=>$lat, 'lon'=>$lon, 'place'=>$place ?: null]; $all = []; $health = []; foreach ($feeds as $feed) { if (!is_array($feed)) continue; if (empty($feed['enabled'])) continue; if ($category !== '' && ($feed['category'] ?? '') !== $category) continue; if ($source !== '' && ($feed['id'] ?? '') !== $source) continue; $engine = (string)($feed['engine'] ?? ''); $provider = simon_load_provider($engine); $feedStart = microtime(true); if (!$provider) { $health[] = ['id'=>$feed['id'] ?? '', 'name'=>$feed['name'] ?? '', 'ok'=>false, 'error'=>'Provider missing: '.$engine, 'ms'=>0, 'count'=>0]; continue; } try { $result = $provider($feed, $ctx); $items = $result['items'] ?? []; if ($q !== '') { $items = array_values(array_filter($items, function($item) use ($q) { $hay = strtolower(($item['title'] ?? '') . ' ' . ($item['summary'] ?? '') . ' ' . ($item['source'] ?? '') . ' ' . ($item['category'] ?? '')); return str_contains($hay, strtolower($q)); })); } foreach ($items as $item) if (is_array($item)) $all[] = $item; $health[] = [ 'id'=>$feed['id'] ?? '', 'name'=>$feed['name'] ?? '', 'engine'=>$engine, 'category'=>$feed['category'] ?? 'general', 'ok'=>(bool)($result['ok'] ?? false), 'error'=>(string)($result['error'] ?? ''), 'ms'=>round((microtime(true)-$feedStart)*1000), 'count'=>count($items), 'cached_at'=>$result['cached_at'] ?? null, ]; } catch (Throwable $e) { $health[] = ['id'=>$feed['id'] ?? '', 'name'=>$feed['name'] ?? '', 'engine'=>$engine, 'ok'=>false, 'error'=>$e->getMessage(), 'ms'=>round((microtime(true)-$feedStart)*1000), 'count'=>0]; simon_log('provider_error', ['feed'=>$feed['id'] ?? '', 'engine'=>$engine, 'error'=>$e->getMessage()]); } } $all = simon_dedupe_events($all); usort($all, function($a, $b) { $s = ($b['score'] <=> $a['score']); if ($s !== 0) return $s; return strtotime($b['published'] ?? 'now') <=> strtotime($a['published'] ?? 'now'); }); $all = array_slice($all, 0, $limit); $stored = 0; if ($enrich) $all = simon_ai_enrich_events($all, 'local'); if ($store) $stored = simon_ai_store_events($all); $categories = []; foreach ($all as $item) { $cat = $item['category'] ?? 'general'; $categories[$cat] = ($categories[$cat] ?? 0) + 1; } simon_json_response([ 'ok' => true, 'version' => SIMON_FEED_VERSION, 'checkedAt' => gmdate('c'), 'elapsedMs' => round((microtime(true)-$start)*1000), 'count' => count($all), 'categories' => $categories, 'items' => $all, 'stored' => $stored, 'ai' => ['enriched'=>$enrich, 'stored'=>$stored], 'health' => $health, ]);
Save file
Quick jump
open a path
Open