add time and place to rss feeds

This commit is contained in:
Ted Unangst 2019-10-03 15:49:36 -04:00
parent b8e0799b34
commit 26e9a9a232
1 changed files with 10 additions and 0 deletions

10
web.go
View File

@ -175,6 +175,16 @@ func showrss(w http.ResponseWriter, r *http.Request) {
desc += fmt.Sprintf(`<p><a href="%s">Attachment: %s</a>`,
d.URL, html.EscapeString(d.Name))
}
if t := honk.Time; t != nil {
desc += fmt.Sprintf(`<p>Time: %s`, t.StartTime.Local().Format("03:04PM EDT Mon Jan 02"))
if t.Duration != 0 {
desc += fmt.Sprintf(`<br>Duration: %s`, t.Duration)
}
}
if p := honk.Place; p != nil {
desc += fmt.Sprintf(`<p>Location: <a href="%s">%s</a> %f %f`,
html.EscapeString(p.Url), html.EscapeString(p.Name), p.Latitude, p.Longitude)
}
feed.Items = append(feed.Items, &rss.Item{
Title: fmt.Sprintf("%s %s %s", honk.Username, honk.What, honk.XID),