more social card tweaks, and include in RSS as well (#2599)

* move link expander to new file, add test, refactor a bit

* text formatting: include indication if a quote post exists

* rss: include expanded links
This commit is contained in:
bnewbold 2024-01-23 13:16:32 -08:00 committed by GitHub
parent c58e65000d
commit a2f49bb08c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 167 additions and 46 deletions

View file

@ -96,7 +96,10 @@ func (srv *Server) WebProfileRSS(c echo.Context) error {
if err != nil {
return err
}
rec := p.Post.Record.Val.(*appbsky.FeedPost)
rec, ok := p.Post.Record.Val.(*appbsky.FeedPost)
if !ok {
continue
}
// only top-level posts in RSS (no replies)
if rec.Reply != nil {
continue
@ -108,7 +111,7 @@ func (srv *Server) WebProfileRSS(c echo.Context) error {
}
posts = append(posts, Item{
Link: fmt.Sprintf("https://%s/profile/%s/post/%s", req.Host, pv.Handle, aturi.RecordKey().String()),
Description: rec.Text,
Description: ExpandPostText(rec),
PubDate: pubDate,
GUID: ItemGUID{
Value: aturi.String(),