Update image source links for gallery items
Replaced old Dropbox image URLs with new ones in server/gallery-data.json. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 8be78d16-3a9d-4b83-82c2-61663dac2260 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/jdAEdU5 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
ff71db433f
commit
5da2418129
BIN
attached_assets/image_1772614001008.png
Normal file
BIN
attached_assets/image_1772614001008.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 429 KiB |
File diff suppressed because it is too large
Load Diff
@ -365,18 +365,27 @@ export async function registerRoutes(
|
||||
});
|
||||
|
||||
function parseRssItems(xml: string, maxAgeDays?: number): { title: string; link: string; source: string; pubDate: string }[] {
|
||||
const channelTitle = xml.match(/<channel>[\s\S]*?<title>(.*?)<\/title>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||
const items: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||
const itemRegex = /<item>([\s\S]*?)<\/item>/g;
|
||||
let match;
|
||||
while ((match = itemRegex.exec(xml)) !== null && items.length < 10) {
|
||||
while ((match = itemRegex.exec(xml)) !== null && items.length < 15) {
|
||||
const block = match[1];
|
||||
const title = block.match(/<title>(.*?)<\/title>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "") || "";
|
||||
const link = block.match(/<link>(.*?)<\/link>/)?.[1] || "";
|
||||
const source = block.match(/<source[^>]*>(.*?)<\/source>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "") || "";
|
||||
const pubDateRaw = block.match(/<pubDate>(.*?)<\/pubDate>/)?.[1] || "";
|
||||
const title = block.match(/<title>(.*?)<\/title>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||
const link = block.match(/<link>(.*?)<\/link>/)?.[1]?.trim() || "";
|
||||
let source = block.match(/<source[^>]*>(.*?)<\/source>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||
if (!source && block.includes("<dc:creator>")) {
|
||||
source = block.match(/<dc:creator>(.*?)<\/dc:creator>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||
}
|
||||
if (!source) {
|
||||
try { source = new URL(link).hostname.replace("www.", "").split(".")[0]; source = source.charAt(0).toUpperCase() + source.slice(1); } catch {}
|
||||
}
|
||||
if (!source) source = channelTitle;
|
||||
const pubDateRaw = block.match(/<pubDate>(.*?)<\/pubDate>/)?.[1] || block.match(/<dc:date>(.*?)<\/dc:date>/)?.[1] || "";
|
||||
let pubDate = "";
|
||||
try {
|
||||
const d = new Date(pubDateRaw);
|
||||
if (isNaN(d.getTime())) continue;
|
||||
if (maxAgeDays !== undefined) {
|
||||
const ageMs = Date.now() - d.getTime();
|
||||
if (ageMs > maxAgeDays * 24 * 3600000) continue;
|
||||
@ -412,11 +421,10 @@ export async function registerRoutes(
|
||||
|
||||
try {
|
||||
const musicFeeds = [
|
||||
"https://www.br.de/nachrichten/feed/volksmusik,QkXOY9u",
|
||||
"https://rss.orf.at/kultur.xml",
|
||||
"https://www.mdr.de/kultur/musik/index-rss.xml",
|
||||
"https://www.ndr.de/kultur/musik/index-rss.xml",
|
||||
"https://www.swr.de/swr1/rss/musik.xml",
|
||||
"https://www.merkur.de/kultur/musik/rssfeed.rdf",
|
||||
"https://www.stern.de/feed/standard/kultur/",
|
||||
"https://www.spiegel.de/kultur/index.rss",
|
||||
"https://rss.orf.at/oesterreich.xml",
|
||||
];
|
||||
let allItems: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||
const results = await Promise.allSettled(
|
||||
@ -430,7 +438,7 @@ export async function registerRoutes(
|
||||
for (const r of results) {
|
||||
if (r.status === "fulfilled") allItems.push(...r.value);
|
||||
}
|
||||
const musikKeywords = /musik|schlager|volksmusik|oberkrainer|konzert|sänger|lied|album|hit|chor|festival|bühne|oper|melodie/i;
|
||||
const musikKeywords = /musik|schlager|volksmusik|oberkrainer|konzert|sänger|sängerin|lied|album|hit|chor|festival|bühne|oper|melodie|band|pop|rock|charts|song|tour|tournee|rapper|hip.?hop|grammy|award|karneval|fasching|wiesn|oktoberfest|helene.fischer|andrea.berg|florian.silbereisen|kulturnacht|open.air/i;
|
||||
let filtered = allItems.filter(i => musikKeywords.test(i.title));
|
||||
if (filtered.length < 3) filtered = allItems.slice(0, 10);
|
||||
filtered = filtered.slice(0, 10);
|
||||
@ -450,10 +458,10 @@ export async function registerRoutes(
|
||||
|
||||
try {
|
||||
const newsFeeds = [
|
||||
"https://rss.orf.at/news.xml",
|
||||
"https://www.tagesschau.de/xml/rss2/",
|
||||
"https://www.tagesschau.de/xml/rss2_https/",
|
||||
"https://www.n-tv.de/rss",
|
||||
"https://www.zdf.de/rss/zdf/nachrichten",
|
||||
"https://rss.orf.at/oesterreich.xml",
|
||||
"https://www.welt.de/feeds/latest.rss",
|
||||
];
|
||||
let allItems: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||
const results = await Promise.allSettled(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user