Generate RSS to file

This commit is contained in:
2024-03-28 12:51:33 +01:00
parent 600044c621
commit e60e6114bd
2 changed files with 98 additions and 0 deletions

View File

@ -305,6 +305,23 @@ func PublishArticle(db *model.DB, s *control.CookieStore) http.HandlerFunc {
return
}
feed, err := control.GenerateRSS(
db,
"Freimaurer Distrikt Niedersachsen und Sachsen-Anhalt",
"https://distrikt-ni-st.de",
"Freiheit, Gleichheit, Brüderlichkeit, Toleranz und Humanität",
)
if err != nil {
log.Println(err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
if err = control.SaveRSS("tmp/orientexpress_alle.rss", feed); err != nil {
log.Println(err)
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
tmpl, err := template.ParseFiles("web/templates/hub.html")
tmpl = template.Must(tmpl, err)
tmpl.ExecuteTemplate(w, "page-content", session.Values["role"])