Initial commit: RSS feed dashboard aggregating YouTube, Reddit and RT
- PHP 8 + PDO SQLite cache with on-demand TTL refresh and dedup by link hash - laminas-feed + Guzzle for RSS/Atom parsing and HTTP - Bootstrap 5 UI with source and time-range filters, AJAX load-more - User cron-free deployment under Apache/php-fpm; .htaccess hardening
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/** @var array<string, mixed> $app */
|
||||
$app = require __DIR__ . '/src/bootstrap.php';
|
||||
|
||||
$config = $app['config'];
|
||||
$service = $app['service'];
|
||||
|
||||
$refresh = $service->refreshStale();
|
||||
|
||||
$sources = $service->sources();
|
||||
$activeSource = $_GET['source'] ?? null;
|
||||
if (!is_string($activeSource) || !in_array($activeSource, $sources, true)) {
|
||||
$activeSource = null;
|
||||
}
|
||||
|
||||
$ranges = $config['ranges'] ?? [];
|
||||
$activeRange = $_GET['range'] ?? '';
|
||||
if (!is_string($activeRange) || !array_key_exists($activeRange, $ranges)) {
|
||||
$activeRange = '';
|
||||
}
|
||||
$since = $activeRange !== '' ? gmdate('c', time() - (int) $ranges[$activeRange]) : null;
|
||||
|
||||
$page = $service->page($activeSource, 1, (int) $config['page_size'], $since);
|
||||
|
||||
echo App\View::render('layout', [
|
||||
'config' => $config,
|
||||
'sources' => $sources,
|
||||
'activeSource' => $activeSource,
|
||||
'activeRange' => $activeRange,
|
||||
'page' => $page,
|
||||
'refresh' => $refresh,
|
||||
]);
|
||||
Reference in New Issue
Block a user