Aktuelles: preusmeritve, breaking-news in noga kazejo na folx.news namesto na news.folx.tv
This commit is contained in:
@@ -51,7 +51,7 @@ export default function Footer({ narrow }: { narrow?: boolean }) {
|
|||||||
</Link>
|
</Link>
|
||||||
</li>
|
</li>
|
||||||
<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>
|
<span className="hover:text-primary transition-colors cursor-pointer">FOLX NEWS</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
+4
-4
@@ -1076,13 +1076,13 @@ export async function registerRoutes(
|
|||||||
app.get("/api/breaking-news", async (_req, res) => {
|
app.get("/api/breaking-news", async (_req, res) => {
|
||||||
// 31. 8. 2026: blok Aktuelle Nachrichten je vodil na tagesschau, n-tv, ORF
|
// 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
|
// 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 cacheKey = "breaking-news";
|
||||||
const cached = getCached<any[]>(cacheKey, 5 * 60 * 1000);
|
const cached = getCached<any[]>(cacheKey, 5 * 60 * 1000);
|
||||||
if (cached) return res.json(cached);
|
if (cached) return res.json(cached);
|
||||||
|
|
||||||
try {
|
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" },
|
headers: { "user-agent": "folx.tv-widget" },
|
||||||
signal: AbortSignal.timeout(10000),
|
signal: AbortSignal.timeout(10000),
|
||||||
});
|
});
|
||||||
@@ -1114,14 +1114,14 @@ export async function registerRoutes(
|
|||||||
|
|
||||||
const items = kroznik.map((a) => ({
|
const items = kroznik.map((a) => ({
|
||||||
title: String(a.title),
|
title: String(a.title),
|
||||||
link: `https://news.folx.tv/${a.slug}`,
|
link: `https://folx.news/${a.slug}`,
|
||||||
source: String(a.category || "FOLX NEWS"),
|
source: String(a.category || "FOLX NEWS"),
|
||||||
pubDate: relativniCas(a.publishedAt),
|
pubDate: relativniCas(a.publishedAt),
|
||||||
}));
|
}));
|
||||||
if (items.length > 0) setCache(cacheKey, items);
|
if (items.length > 0) setCache(cacheKey, items);
|
||||||
res.json(items);
|
res.json(items);
|
||||||
} catch (err: any) {
|
} 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);
|
const stale = getStale<any[]>(cacheKey);
|
||||||
res.json(stale || []);
|
res.json(stale || []);
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -106,14 +106,14 @@ const PUBLISHER = (base: string) => ({
|
|||||||
const ONE_RUBRIKEN = new Set(["Politik", "Promis", "Sport", "Musik & Film", "Wetter", "Finanzen", "Aktuelles"]);
|
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
|
// 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,
|
// folx.news. Stare povezave s Facebooka in Googla morajo se vedno delati,
|
||||||
// zato ob neznanem slugu vprasamo news.folx.tv, ali ga pozna, in preusmerimo.
|
// zato ob neznanem slugu vprasamo folx.news, ali ga pozna, in preusmerimo.
|
||||||
let NEWS_SLUGS: Set<string> = new Set();
|
let NEWS_SLUGS: Set<string> = new Set();
|
||||||
let NEWS_SLUGS_AT = 0;
|
let NEWS_SLUGS_AT = 0;
|
||||||
async function newsHasSlug(slug: string): Promise<boolean> {
|
async function newsHasSlug(slug: string): Promise<boolean> {
|
||||||
if (Date.now() - NEWS_SLUGS_AT > 600000) {
|
if (Date.now() - NEWS_SLUGS_AT > 600000) {
|
||||||
try {
|
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" },
|
headers: { "user-agent": "folx.tv-redirect" },
|
||||||
signal: AbortSignal.timeout(10000),
|
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.
|
// 29. 8. 2026: rubrike Aktuelles so preseljene na loceno stran folx.news.
|
||||||
// Clanki ostanejo v bazi in v /api/articles (bere jih news.folx.tv in TV sidebar),
|
// Clanki ostanejo v bazi in v /api/articles (bere jih folx.news in TV sidebar),
|
||||||
// na folx.tv pa se naslovi trajno preusmerijo.
|
// 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> = {
|
const NEWS_RUBRIK_SLUG: Record<string, string | undefined> = {
|
||||||
"Politik": "politik",
|
"Politik": "politik",
|
||||||
"Promis": "promis",
|
"Promis": "promis",
|
||||||
|
|||||||
Reference in New Issue
Block a user