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
+1 -1
View File
@@ -51,7 +51,7 @@ export default function Footer({ narrow }: { narrow?: boolean }) {
</Link>
</li>
<li>
<a href="https://news.folx.tv/" target="_blank" rel="noopener">
<a href="https://folx.news/" target="_blank" rel="noopener">
<span className="hover:text-primary transition-colors cursor-pointer">FOLX NEWS</span>
</a>
</li>
+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 || []);
}
+6 -6
View File
@@ -106,14 +106,14 @@ const PUBLISHER = (base: string) => ({
const ONE_RUBRIKEN = new Set(["Politik", "Promis", "Sport", "Musik & Film", "Wetter", "Finanzen", "Aktuelles"]);
// 30. 8. 2026: rubrike so izbrisane iz baze folx.tv in zivijo samo se na
// news.folx.tv. Stare povezave s Facebooka in Googla morajo se vedno delati,
// zato ob neznanem slugu vprasamo news.folx.tv, ali ga pozna, in preusmerimo.
// folx.news. Stare povezave s Facebooka in Googla morajo se vedno delati,
// zato ob neznanem slugu vprasamo folx.news, ali ga pozna, in preusmerimo.
let NEWS_SLUGS: Set<string> = new Set();
let NEWS_SLUGS_AT = 0;
async function newsHasSlug(slug: string): Promise<boolean> {
if (Date.now() - NEWS_SLUGS_AT > 600000) {
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-redirect" },
signal: AbortSignal.timeout(10000),
});
@@ -351,10 +351,10 @@ export function serveStatic(app: Express) {
}
}
// 29. 8. 2026: rubrike Aktuelles so preseljene na loceno stran news.folx.tv.
// Clanki ostanejo v bazi in v /api/articles (bere jih news.folx.tv in TV sidebar),
// 29. 8. 2026: rubrike Aktuelles so preseljene na loceno stran folx.news.
// Clanki ostanejo v bazi in v /api/articles (bere jih folx.news in TV sidebar),
// na folx.tv pa se naslovi trajno preusmerijo.
const NEWS_HOST = "https://news.folx.tv";
const NEWS_HOST = "https://folx.news";
const NEWS_RUBRIK_SLUG: Record<string, string | undefined> = {
"Politik": "politik",
"Promis": "promis",