flux rss v1
This commit is contained in:
parent
794f971b73
commit
f46a1c7e4b
@ -57,7 +57,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if ($ts > $last_fetch) $last_fetch = $ts;
|
||||
}
|
||||
}
|
||||
if (time() - $last_fetch < 300) { // 5 minutes
|
||||
if (time() - $last_fetch < 120) { // 2 minutes to match JS
|
||||
echo json_encode(['success' => true, 'new_items' => 0, 'skipped' => true]);
|
||||
exit;
|
||||
}
|
||||
@ -80,9 +80,23 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
foreach ($items as $item) {
|
||||
$guid = (string)($item->guid ?? ($item->id ?? $item->link));
|
||||
if (empty($guid) && isset($item->link['href'])) {
|
||||
$guid = (string)$item->link['href'];
|
||||
}
|
||||
|
||||
$title = (string)$item->title;
|
||||
$link = (string)($item->link['href'] ?? $item->link);
|
||||
$description = strip_tags((string)($item->description ?? $item->summary));
|
||||
if (empty($link) && isset($item->link)) {
|
||||
foreach($item->link as $l) {
|
||||
if ($l['rel'] == 'alternate' || !$l['rel']) {
|
||||
$link = (string)$l['href'];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$description = (string)($item->description ?? ($item->summary ?? $item->content));
|
||||
$description = strip_tags($description);
|
||||
|
||||
// Extract additional fields
|
||||
$category = (string)($item->category ?? ($item->category['term'] ?? ''));
|
||||
|
||||
@ -1413,7 +1413,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const autoSyncRss = async () => {
|
||||
// Check if we are in an announcement channel
|
||||
// We can look for the bullhorn icon in the header
|
||||
const headerIcon = document.querySelector('.main-header i.fa-bullhorn');
|
||||
const headerIcon = document.querySelector('.chat-header i.fa-bullhorn');
|
||||
if (headerIcon) {
|
||||
const formData = new FormData();
|
||||
formData.append('action', 'sync');
|
||||
|
||||
@ -399,3 +399,9 @@
|
||||
2026-02-16 23:36:54 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
2026-02-16 23:37:08 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
2026-02-16 23:37:26 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
2026-02-16 23:39:35 - GET /?fl_project=38443 - POST: []
|
||||
2026-02-16 23:39:49 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
2026-02-16 23:39:52 - GET /index.php?server_id=1&channel_id=1 - POST: []
|
||||
2026-02-16 23:39:53 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
2026-02-16 23:40:18 - GET /index.php?server_id=1&channel_id=17 - POST: []
|
||||
2026-02-16 23:40:19 - GET /index.php?server_id=1&channel_id=12 - POST: []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user