Aktuelles: preusmeritve, breaking-news in noga kazejo na folx.news namesto na news.folx.tv

This commit is contained in:
folx bot
2026-09-02 10:47:43 +02:00
parent 69d9d87778
commit a31797a807
3 changed files with 11 additions and 11 deletions
+4 -4
View File
@@ -1076,13 +1076,13 @@ export async function registerRoutes(
app.get("/api/breaking-news", async (_req, res) => {
// 31. 8. 2026: blok Aktuelle Nachrichten je vodil na tagesschau, n-tv, ORF
// in Welt, torej smo obiskovalce posiljali s strani. Zdaj kaze nase novice
// z news.folx.tv, kjer imamo oglase.
// z folx.news (locena domena, brez oglasov).
const cacheKey = "breaking-news";
const cached = getCached<any[]>(cacheKey, 5 * 60 * 1000);
if (cached) return res.json(cached);
try {
const r = await fetch("https://news.folx.tv/api/articles", {
const r = await fetch("https://folx.news/api/articles", {
headers: { "user-agent": "folx.tv-widget" },
signal: AbortSignal.timeout(10000),
});
@@ -1114,14 +1114,14 @@ export async function registerRoutes(
const items = kroznik.map((a) => ({
title: String(a.title),
link: `https://news.folx.tv/${a.slug}`,
link: `https://folx.news/${a.slug}`,
source: String(a.category || "FOLX NEWS"),
pubDate: relativniCas(a.publishedAt),
}));
if (items.length > 0) setCache(cacheKey, items);
res.json(items);
} catch (err: any) {
console.log("[breaking-news] news.folx.tv error:", err.message);
console.log("[breaking-news] folx.news error:", err.message);
const stale = getStale<any[]>(cacheKey);
res.json(stale || []);
}