mirror of
https://github.com/myronblair/jarvis
synced 2026-06-30 17:50:23 -05:00
dc55e6c45b
- 4-tier chat: HA control → Ollama → Groq → Claude - Push-based agent system with heartbeat/metrics - Network monitoring, alerts, Proxmox, Home Assistant - Windows + Linux agent installers - Stats cache cron, facts collector, KB engine
21 lines
615 B
PHP
21 lines
615 B
PHP
<?php
|
|
// News endpoint — serves from api_cache (refreshed every 30 min by cron)
|
|
|
|
$cached = JarvisDB::query(
|
|
'SELECT data, UNIX_TIMESTAMP(updated_at) as ts FROM api_cache WHERE cache_key=? LIMIT 1',
|
|
['news']
|
|
);
|
|
|
|
if ($cached && !empty($cached[0]['data'])) {
|
|
$out = json_decode($cached[0]['data'], true);
|
|
$out['cache_age_s'] = (int)(time() - (int)$cached[0]['ts']);
|
|
echo json_encode($out);
|
|
} else {
|
|
echo json_encode([
|
|
'categories' => [],
|
|
'total' => 0,
|
|
'cache_age_s' => -1,
|
|
'message' => 'News feed warming up — available within 5 minutes.',
|
|
]);
|
|
}
|