update rss for some recent changes
Ted Unangst tedu@tedunangst.com
Mon, 15 Apr 2019 10:56:43 -0400
1 files changed,
7 insertions(+),
3 deletions(-)
jump to
M
honk.go
→
honk.go
@@ -21,6 +21,7 @@ "crypto/rand"
"crypto/rsa" "database/sql" "fmt" + "html" "html/template" "image" _ "image/gif"@@ -180,12 +181,15 @@ for _, honk := range honks {
if honk.Date.Before(past) { break } - if honk.URL[0] == '/' { - honk.URL = "https://" + serverName + honk.URL + desc := string(honk.HTML) + for _, d := range honk.Donks { + desc += fmt.Sprintf(`<p><a href="%sd/%s">Attachment: %s</a>`, + base, d.XID, html.EscapeString(d.Name)) } + feed.Items = append(feed.Items, &RssItem{ Title: fmt.Sprintf("%s %s %s", honk.Username, honk.What, honk.XID), - Description: RssCData{string(honk.HTML)}, + Description: RssCData{desc}, Link: honk.URL, PubDate: honk.Date.Format(time.RFC1123), })