all repos — honk @ e0cc48fd6d5ce43fdced313e4ec943bfb9c9bd95

my fork of honk

update rss for some recent changes
Ted Unangst tedu@tedunangst.com
Mon, 15 Apr 2019 10:56:43 -0400
commit

e0cc48fd6d5ce43fdced313e4ec943bfb9c9bd95

parent

c8936bd6d98a5c46e4e313e9978e2f5d9c2ca462

1 files changed, 7 insertions(+), 3 deletions(-)

jump to
M honk.gohonk.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), })