Skip to content

Commit c3f7f1a

Browse files
committed
feat: Render full HTML body in RSS feed from Luma API
Signed-off-by: Felicitas Pojtinger <[email protected]>
1 parent 6690306 commit c3f7f1a

6 files changed

Lines changed: 308 additions & 30 deletions

File tree

content/privacy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ When accessing our website, the following information is processed for the reaso
3232

3333
#### 3.2 Luma Event Data
3434

35-
Our home page and events page fetch event data from Luma's API via our API proxy on Railway. Your browser connects to our proxy, not directly to Luma. No data is sent to Luma from your browser. We also provide a RSS/Atom feed of upcoming events via the same proxy.
35+
Our home page and events page fetch event data from Luma's API via our API proxy on Railway. Your browser connects to our proxy, not directly to Luma. No data is sent to Luma from your browser. We also provide a RSS/Atom feed of upcoming events via the same proxy; when you subscribe to it, your feed reader connects to our proxy, which fetches event listings and per-event descriptions from Luma's API on your behalf.
3636

3737
Luma, Inc.\
3838
548 Market St PMB 36143\
@@ -42,7 +42,7 @@ Privacy policy: [https://luma.com/privacy-policy](https://luma.com/privacy-polic
4242

4343
#### 3.3 Mastodon Feed Data
4444

45-
Our home page fetches recent posts from our Mastodon account via our API proxy on Railway. Your browser connects to our proxy, not directly to [thecanadian.social](https://thecanadian.social). No data is sent to [thecanadian.social](https://thecanadian.social) from your browser.
45+
Our home page fetches recent posts from our Mastodon account via our API proxy on Railway. Your browser connects to our proxy, not directly to [thecanadian.social](https://thecanadian.social). No data is sent to [thecanadian.social](https://thecanadian.social) from your browser. We also link to the public Mastodon RSS feed at `thecanadian.social/@vanlug.rss`; if you subscribe to it, your feed reader connects directly to [thecanadian.social](https://thecanadian.social).
4646

4747
The Canadian ([thecanadian.social](https://thecanadian.social))\
4848
Kelowna and Burnaby, British Columbia\

go.mod

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,14 @@ require (
77
github.com/pojntfx/felicitas.pojtinger.com v0.4.1
88
)
99

10-
require github.com/gorilla/feeds v1.2.0
10+
require (
11+
github.com/gorilla/feeds v1.2.0
12+
github.com/nicksrandall/prosemirror-go v0.0.0-20170601171447-b0778c4954c7
13+
golang.org/x/sync v0.20.0
14+
)
1115

1216
require (
1317
github.com/gorilla/websocket v1.5.3 // indirect
18+
github.com/stretchr/testify v1.11.1 // indirect
1419
github.com/tomnomnom/linkheader v0.0.0-20250811210735-e5fe3b51442e // indirect
1520
)

go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
13
github.com/gorilla/feeds v1.2.0 h1:O6pBiXJ5JHhPvqy53NsjKOThq+dNFm8+DFrxBEdzSCc=
24
github.com/gorilla/feeds v1.2.0/go.mod h1:WMib8uJP3BbY+X8Szd1rA5Pzhdfh+HCCAYT2z7Fza6Y=
35
github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg=
@@ -8,9 +10,19 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
810
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
911
github.com/mattn/go-mastodon v0.0.11 h1:Zcvc/8EHpf3os1mwAuUUB5es5VnfVdAeb4ed6ByJnCY=
1012
github.com/mattn/go-mastodon v0.0.11/go.mod h1:0DcwYEkqigrvknMvjmfKXLP0vYyeYm+vBdUOvoHcczg=
13+
github.com/nicksrandall/prosemirror-go v0.0.0-20170601171447-b0778c4954c7 h1:hqdxE60dI1SB2L1jp9B4dIAg4zxnsIL6uR/FiDpucOQ=
14+
github.com/nicksrandall/prosemirror-go v0.0.0-20170601171447-b0778c4954c7/go.mod h1:SxVP5G6CLbm5BLRI6CKfAAgr8Ark2LSkCUwazP6vF4g=
15+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
16+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
1117
github.com/pojntfx/felicitas.pojtinger.com v0.4.1 h1:bTUaI/b8csLNWjsEBqb2d3Xao6njUst5XPOREuOfkiM=
1218
github.com/pojntfx/felicitas.pojtinger.com v0.4.1/go.mod h1:XaKmAAyinrHKMlRAXF7/rhBeENkC6e/Zf2SrhIGMgbo=
1319
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
1420
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
21+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
22+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
1523
github.com/tomnomnom/linkheader v0.0.0-20250811210735-e5fe3b51442e h1:tD38/4xg4nuQCASJ/JxcvCHNb46w0cdAaJfkzQOO1bA=
1624
github.com/tomnomnom/linkheader v0.0.0-20250811210735-e5fe3b51442e/go.mod h1:krvJ5AY/MjdPkTeRgMYbIDhbbbVvnPQPzsIsDJO8xrY=
25+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
26+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
27+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
28+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

main.go

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@ import (
1010
"github.com/vanlug/vanlug.github.io/pkg/handlers"
1111
)
1212

13-
const defaultLumaAPIBase = "https://api.luma.com/calendar/get-items"
13+
const (
14+
defaultLumaAPIBase = "https://api.luma.com/calendar/get-items"
15+
defaultLumaEventDetailBase = "https://api.luma.com/event/get"
16+
defaultLumaBase = "https://luma.com"
17+
defaultMapBase = "https://cartes.app/"
18+
)
1419

1520
func Handler(w http.ResponseWriter, r *http.Request) {
1621
handlers.NextEventHandler(w, r, defaultLumaAPIBase)
1722
}
1823

24+
func FeedHandler(w http.ResponseWriter, r *http.Request) {
25+
handlers.EventsFeedHandler(w, r, defaultLumaAPIBase, defaultLumaEventDetailBase, defaultLumaBase, defaultMapBase, "https://vanlug.ca/")
26+
}
27+
1928
func main() {
2029
port := os.Getenv("PORT")
2130
if port == "" {
@@ -32,6 +41,21 @@ func main() {
3241
apiBase = defaultLumaAPIBase
3342
}
3443

44+
eventDetailBase := os.Getenv("LUMA_EVENT_DETAIL_BASE")
45+
if eventDetailBase == "" {
46+
eventDetailBase = defaultLumaEventDetailBase
47+
}
48+
49+
lumaBase := os.Getenv("LUMA_BASE")
50+
if lumaBase == "" {
51+
lumaBase = defaultLumaBase
52+
}
53+
54+
mapBase := os.Getenv("MAP_BASE")
55+
if mapBase == "" {
56+
mapBase = defaultMapBase
57+
}
58+
3559
siteURL := os.Getenv("SITE_URL")
3660
if siteURL == "" {
3761
siteURL = "https://vanlug.ca/"
@@ -103,7 +127,7 @@ func main() {
103127
}
104128
}()
105129

106-
handlers.EventsFeedHandler(w, r, apiBase, siteURL)
130+
handlers.EventsFeedHandler(w, r, apiBase, eventDetailBase, lumaBase, mapBase, siteURL)
107131
}))
108132

109133
mux.HandleFunc("/mastodon", cors(func(w http.ResponseWriter, r *http.Request) {

pkg/handlers/feed_entry.html.tmpl

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{{ if .CoverURL -}}
2+
<p><img src="{{ .CoverURL }}" alt="{{ .Name }}" /></p>
3+
{{ end -}}
4+
5+
<h2>{{ .Name }}</h2>
6+
7+
<p>
8+
<strong>Date:</strong> {{ .DateLine }}<br/>
9+
<strong>Time:</strong> {{ .TimeLine }}
10+
</p>
11+
12+
{{ if .Location -}}
13+
<p>
14+
<strong>Venue:</strong> {{ .Location }}
15+
{{- if .FullAddress }}<br/>{{ .FullAddress }}{{ end }}
16+
</p>
17+
{{ end -}}
18+
19+
{{ if .Hosts -}}
20+
<p><strong>Hosted by:</strong> {{ .Hosts }}</p>
21+
{{ end -}}
22+
23+
{{ if .Admission -}}
24+
<p><strong>Admission:</strong> {{ .Admission }}</p>
25+
{{ end -}}
26+
27+
{{ if .Description -}}
28+
<hr/>
29+
{{ .Description }}
30+
{{ end -}}
31+
32+
<p><a href="{{ .Link }}">RSVP on Luma</a></p>
33+
34+
{{ if .MapURL -}}
35+
<p><a href="{{ .MapURL }}">View on map</a></p>
36+
{{ end -}}

0 commit comments

Comments
 (0)