Compare commits

...

3 Commits

Author SHA1 Message Date
Paul Frazee 3e7c1633e0 Update prod favicons 2023-12-22 10:44:20 -08:00
Jake Gold e2e7a5f068 bskyweb: build/push container to AWS on 1.60 branch 2023-12-22 10:28:59 -08:00
bnewbold b708d8c2f7 bskyweb: iterate on RSS format, based on feedback (#2269)
Thanks to Dave Winer (@scripting)!
2023-12-22 08:08:11 -08:00
7 changed files with 20 additions and 5 deletions
@@ -5,6 +5,7 @@ on:
- main
- traffic-reduction
- respect-optout-for-embeds
- 1.60
env:
REGISTRY: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_REGISTRY }}
USERNAME: ${{ secrets.AWS_ECR_REGISTRY_USEAST2_PACKAGES_USERNAME }}
+19 -5
View File
@@ -1,8 +1,10 @@
package main
import (
"encoding/xml"
"fmt"
"net/http"
"time"
appbsky "github.com/bluesky-social/indigo/api/bsky"
"github.com/bluesky-social/indigo/atproto/syntax"
@@ -10,6 +12,12 @@ import (
"github.com/labstack/echo/v4"
)
type ItemGUID struct {
XMLName xml.Name `xml:"guid"`
Value string `xml:",chardata"`
IsPerma bool `xml:"isPermalink,attr"`
}
// We don't actually populate the title for "posts".
// Some background: https://book.micro.blog/rss-for-microblogs/
type Item struct {
@@ -17,8 +25,7 @@ type Item struct {
Link string `xml:"link,omitempty"`
Description string `xml:"description,omitempty"`
PubDate string `xml:"pubDate,omitempty"`
Author string `xml:"author,omitempty"`
GUID string `xml:"guid,omitempty"`
GUID ItemGUID
}
type rss struct {
@@ -71,12 +78,19 @@ func (srv *Server) WebProfileRSS(c echo.Context) error {
if rec.Reply != nil {
continue
}
pubDate := ""
createdAt, err := syntax.ParseDatetimeLenient(rec.CreatedAt)
if nil == err {
pubDate = createdAt.Time().Format(time.RFC822Z)
}
posts = append(posts, Item{
Link: fmt.Sprintf("https://bsky.app/profile/%s/post/%s", pv.Handle, aturi.RecordKey().String()),
Description: rec.Text,
PubDate: rec.CreatedAt,
Author: "@" + pv.Handle,
GUID: aturi.String(),
PubDate: pubDate,
GUID: ItemGUID{
Value: aturi.String(),
IsPerma: false,
},
})
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 769 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB