Lasa is a stateless proxy that generates a RSS or an Atom feed from a Standard.site publication.
lasa.anhgelus.world
rss
atom
atprotocol
standard-site
atproto
1package lasa
2
3import (
4 "context"
5 "embed"
6 "io"
7 "text/template"
8
9 site "tangled.org/anhgelus.world/goat-site"
10 "tangled.org/anhgelus.world/xrpc"
11 "tangled.org/anhgelus.world/xrpc/atproto"
12)
13
14//go:embed atom.xml
15var atomTemplate embed.FS
16
17func GenerateAtom(
18 ctx context.Context,
19 client xrpc.Client,
20 w io.Writer,
21 author *atproto.DID,
22 pub xrpc.RecordStored[*site.Publication],
23) error {
24 data, err := genFeedData(ctx, client, author, pub)
25 if err != nil {
26 return err
27 }
28 return template.Must(template.New("rss").Funcs(map[string]any{
29 "isSet": IsSet,
30 }).ParseFS(atomTemplate, "atom.xml")).ExecuteTemplate(w, "atom.xml", data)
31}