Changes to the compse yml and the way and amout of artikeltexte are delivered and taht not duplicates are displayed

This commit is contained in:
hubble_dubble
2026-01-26 00:59:03 +00:00
parent 08a1f54a40
commit 71ff9344a1
4 changed files with 89 additions and 13 deletions

View File

@@ -38,10 +38,16 @@ async function loadNews() {
const lines = text.split("\n").map((line) => line.trim()).filter(Boolean);
const items = [];
const seen = new Set();
for (const line of lines) {
try {
const parsed = JSON.parse(line);
const fallbackTitle = stripTags(parsed.title);
const id = parsed.id || parsed.link || fallbackTitle || `idx:${items.length}`;
if (seen.has(id)) continue;
seen.add(id);
items.push({
id,
title: stripTags(parsed.title),
text: stripTags(parsed.text),
link: parsed.link,
@@ -49,7 +55,7 @@ async function loadNews() {
} catch (err) {
console.warn("NDJSON parse error", err);
}
if (items.length >= 60) break;
if (items.length >= 20) break;
}
newsContainer.innerHTML = "";