Odstranjeni kozmicni dogodki: stran, scheduler in API
This commit is contained in:
+1
-21
@@ -3,7 +3,7 @@ import { createServer, type Server } from "http";
|
||||
import { storage } from "./storage";
|
||||
import { insertArticleSchema } from "@shared/schema";
|
||||
import { seedDatabase } from "./seed";
|
||||
import { generateDailyHoroscopes, getHoroscopesForToday, getOrGenerateHoroscope, getCosmicEventsForToday, generateCosmicEvents, setHoroscopeImages } from "./horoscope-generator";
|
||||
import { generateDailyHoroscopes, getHoroscopesForToday, getOrGenerateHoroscope, setHoroscopeImages } from "./horoscope-generator";
|
||||
import { startDailyScheduler } from "./scheduler";
|
||||
import { analyzeAllArticleImages, getCachedFocalPoints } from "./focal-point";
|
||||
import { optimizeImage } from "./image-optimizer";
|
||||
@@ -786,26 +786,6 @@ export async function registerRoutes(
|
||||
}
|
||||
});
|
||||
|
||||
// Cosmic events API
|
||||
app.get("/api/cosmic-events", async (_req, res) => {
|
||||
try {
|
||||
const events = await getCosmicEventsForToday();
|
||||
res.json(events);
|
||||
} catch (err: any) {
|
||||
res.status(500).json({ message: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
app.post("/api/cosmic-events/generate", async (_req, res) => {
|
||||
try {
|
||||
await generateCosmicEvents();
|
||||
const events = await getCosmicEventsForToday();
|
||||
res.json({ generated: events.length, events });
|
||||
} catch (err: any) {
|
||||
res.status(500).json({ message: err.message });
|
||||
}
|
||||
});
|
||||
|
||||
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 }[] = [];
|
||||
|
||||
Reference in New Issue
Block a user