aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/parse.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/feed/parse.go')
-rw-r--r--internal/feed/parse.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/feed/parse.go b/internal/feed/parse.go
index a38be92..00b6aff 100644
--- a/internal/feed/parse.go
+++ b/internal/feed/parse.go
@@ -19,10 +19,16 @@ func parseFeed(feed *Feed) error {
ctx, cancel := context()
defer cancel()
fp := gofeed.NewParser()
- if _, err := fp.ParseURLWithContext(feed.Url, ctx); err != nil {
+ parsedFeed, err := fp.ParseURLWithContext(feed.Url, ctx)
+ if err != nil {
return fmt.Errorf("while fetching %s from %s: %w", feed.Name, feed.Url, err)
}
+ feed.feed = parsedFeed
+ feed.items = make([]feeditem, len(parsedFeed.Items))
+ for _, item := range parsedFeed.Items {
+ feed.items = append(feed.items, feeditem{parsedFeed, item})
+ }
return nil
}