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 }[] {
|
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 items: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||||
const itemRegex = /<item>([\s\S]*?)<\/item>/g;
|
const itemRegex = /<item>([\s\S]*?)<\/item>/g;
|
||||||
let match;
|
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 block = match[1];
|
||||||
const title = block.match(/<title>(.*?)<\/title>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "") || "";
|
const title = block.match(/<title>(.*?)<\/title>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||||
const link = block.match(/<link>(.*?)<\/link>/)?.[1] || "";
|
const link = block.match(/<link>(.*?)<\/link>/)?.[1]?.trim() || "";
|
||||||
const source = block.match(/<source[^>]*>(.*?)<\/source>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "") || "";
|
let source = block.match(/<source[^>]*>(.*?)<\/source>/)?.[1]?.replace(/<!\[CDATA\[|\]\]>/g, "").trim() || "";
|
||||||
const pubDateRaw = block.match(/<pubDate>(.*?)<\/pubDate>/)?.[1] || "";
|
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 = "";
|
let pubDate = "";
|
||||||
try {
|
try {
|
||||||
const d = new Date(pubDateRaw);
|
const d = new Date(pubDateRaw);
|
||||||
|
if (isNaN(d.getTime())) continue;
|
||||||
if (maxAgeDays !== undefined) {
|
if (maxAgeDays !== undefined) {
|
||||||
const ageMs = Date.now() - d.getTime();
|
const ageMs = Date.now() - d.getTime();
|
||||||
if (ageMs > maxAgeDays * 24 * 3600000) continue;
|
if (ageMs > maxAgeDays * 24 * 3600000) continue;
|
||||||
@ -412,11 +421,10 @@ export async function registerRoutes(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const musicFeeds = [
|
const musicFeeds = [
|
||||||
"https://www.br.de/nachrichten/feed/volksmusik,QkXOY9u",
|
"https://www.merkur.de/kultur/musik/rssfeed.rdf",
|
||||||
"https://rss.orf.at/kultur.xml",
|
"https://www.stern.de/feed/standard/kultur/",
|
||||||
"https://www.mdr.de/kultur/musik/index-rss.xml",
|
"https://www.spiegel.de/kultur/index.rss",
|
||||||
"https://www.ndr.de/kultur/musik/index-rss.xml",
|
"https://rss.orf.at/oesterreich.xml",
|
||||||
"https://www.swr.de/swr1/rss/musik.xml",
|
|
||||||
];
|
];
|
||||||
let allItems: { title: string; link: string; source: string; pubDate: string }[] = [];
|
let allItems: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||||
const results = await Promise.allSettled(
|
const results = await Promise.allSettled(
|
||||||
@ -430,7 +438,7 @@ export async function registerRoutes(
|
|||||||
for (const r of results) {
|
for (const r of results) {
|
||||||
if (r.status === "fulfilled") allItems.push(...r.value);
|
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));
|
let filtered = allItems.filter(i => musikKeywords.test(i.title));
|
||||||
if (filtered.length < 3) filtered = allItems.slice(0, 10);
|
if (filtered.length < 3) filtered = allItems.slice(0, 10);
|
||||||
filtered = filtered.slice(0, 10);
|
filtered = filtered.slice(0, 10);
|
||||||
@ -450,10 +458,10 @@ export async function registerRoutes(
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const newsFeeds = [
|
const newsFeeds = [
|
||||||
"https://rss.orf.at/news.xml",
|
"https://www.tagesschau.de/xml/rss2_https/",
|
||||||
"https://www.tagesschau.de/xml/rss2/",
|
|
||||||
"https://www.n-tv.de/rss",
|
"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 }[] = [];
|
let allItems: { title: string; link: string; source: string; pubDate: string }[] = [];
|
||||||
const results = await Promise.allSettled(
|
const results = await Promise.allSettled(
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user