Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

bskyweb: iterate on RSS format, based on feedback (#2269)

Thanks to Dave Winer (@scripting)!

authored by

bnewbold and committed by
GitHub
a5c151c0 64dc8ff3

+19 -5
+19 -5
bskyweb/cmd/bskyweb/rss.go
··· 1 1 package main 2 2 3 3 import ( 4 + "encoding/xml" 4 5 "fmt" 5 6 "net/http" 7 + "time" 6 8 7 9 appbsky "github.com/bluesky-social/indigo/api/bsky" 8 10 "github.com/bluesky-social/indigo/atproto/syntax" ··· 10 12 "github.com/labstack/echo/v4" 11 13 ) 12 14 15 + type ItemGUID struct { 16 + XMLName xml.Name `xml:"guid"` 17 + Value string `xml:",chardata"` 18 + IsPerma bool `xml:"isPermalink,attr"` 19 + } 20 + 13 21 // We don't actually populate the title for "posts". 14 22 // Some background: https://book.micro.blog/rss-for-microblogs/ 15 23 type Item struct { ··· 17 25 Link string `xml:"link,omitempty"` 18 26 Description string `xml:"description,omitempty"` 19 27 PubDate string `xml:"pubDate,omitempty"` 20 - Author string `xml:"author,omitempty"` 21 - GUID string `xml:"guid,omitempty"` 28 + GUID ItemGUID 22 29 } 23 30 24 31 type rss struct { ··· 71 78 if rec.Reply != nil { 72 79 continue 73 80 } 81 + pubDate := "" 82 + createdAt, err := syntax.ParseDatetimeLenient(rec.CreatedAt) 83 + if nil == err { 84 + pubDate = createdAt.Time().Format(time.RFC822Z) 85 + } 74 86 posts = append(posts, Item{ 75 87 Link: fmt.Sprintf("https://bsky.app/profile/%s/post/%s", pv.Handle, aturi.RecordKey().String()), 76 88 Description: rec.Text, 77 - PubDate: rec.CreatedAt, 78 - Author: "@" + pv.Handle, 79 - GUID: aturi.String(), 89 + PubDate: pubDate, 90 + GUID: ItemGUID{ 91 + Value: aturi.String(), 92 + IsPerma: false, 93 + }, 80 94 }) 81 95 } 82 96