Read news basis

 Able to read wordpress site

btw the 10 yrs ago package still work properly, amazing...
means the wordpress api did not change a lot and the golang backward
compability is amazing!
This commit is contained in:
2025-01-25 22:05:38 +08:00
parent e055ef27e5
commit ab0a87106b
11 changed files with 185 additions and 19 deletions

View File

@@ -72,9 +72,15 @@ func main() {
log.Fatal().Err(err).Msg("An error occurred when initializing cache.")
}
// Load news sources
if err := services.LoadNewsSources(); err != nil {
log.Fatal().Err(err).Msg("An error occurred when loading news sources.")
}
// Configure timed tasks
quartz := cron.New(cron.WithLogger(cron.VerbosePrintfLogger(&log.Logger)))
quartz.AddFunc("@every 60m", services.DoAutoDatabaseCleanup)
quartz.AddFunc("@midnight", services.ScanNewsSources)
quartz.Start()
// Server