- commit
- 0c37db1
- parent
- 12c3f12
- author
- Eric Bower
- date
- 2026-03-08 09:45:46 -0400 EDT
fix(feeds): parse urls properly with comments
2 files changed,
+15,
-11
+2,
-2
1@@ -23,8 +23,8 @@ func NewConfigSite(service string) *shared.ConfigSite {
2 Protocol: protocol,
3 DbURL: dbURL,
4 Space: "feeds",
5- AllowedExt: []string{".txt"},
6- HiddenPosts: []string{"_header.txt", "_readme.txt"},
7+ AllowedExt: []string{".txt", ".lxt"},
8+ HiddenPosts: []string{},
9 Logger: shared.CreateLogger(service, withPipe),
10 }
11 }
+13,
-9
1@@ -227,25 +227,25 @@ func (f *Fetcher) RunPost(logger *slog.Logger, user *db.User, isPicoPlus bool, p
2
3 urls := []string{}
4 for _, item := range parsed.Items {
5- u := ""
6- if item.IsText || item.IsURL {
7- u = item.Value
8+ rawUrl := ""
9+ if item.IsText {
10+ rawUrl = string(item.Value)
11 } else if item.IsURL {
12- u = string(item.Value)
13+ rawUrl = string(item.URL)
14 }
15
16- if u == "" {
17+ if rawUrl == "" {
18 continue
19 }
20
21- _, err := url.Parse(string(item.URL))
22+ _, err := url.Parse(rawUrl)
23 if err != nil {
24- logger.Info("invalid url", "url", string(item.URL))
25+ logger.Info("invalid url", "url", rawUrl)
26 continue
27 }
28
29- logger.Info("found rss feed url", "url", u)
30- urls = append(urls, u)
31+ logger.Info("found rss feed url", "url", rawUrl)
32+ urls = append(urls, rawUrl)
33 }
34
35 if post.ExpiresAt == nil {
36@@ -344,6 +344,10 @@ func (f *Fetcher) RunUser(user *db.User, now time.Time) error {
37 }
38 }
39
40+ if !isPicoPlus {
41+ return fmt.Errorf("must be pico+ user to receive rss digests")
42+ }
43+
44 if len(posts.Data) > 0 {
45 logger.Info("found feed posts", "len", len(posts.Data))
46 }