Allow using alternative links for YT, HN and reddit

This commit is contained in:
Svilen Markov
2024-05-01 19:08:25 +01:00
parent d5d6103327
commit 44a153d30a
7 changed files with 109 additions and 25 deletions

View File

@ -10,10 +10,11 @@ import (
)
type HackerNews struct {
widgetBase `yaml:",inline"`
Posts feed.ForumPosts `yaml:"-"`
Limit int `yaml:"limit"`
CollapseAfter int `yaml:"collapse-after"`
widgetBase `yaml:",inline"`
Posts feed.ForumPosts `yaml:"-"`
Limit int `yaml:"limit"`
CollapseAfter int `yaml:"collapse-after"`
CommentsUrlTemplate string `yaml:"comments-url-template"`
}
func (widget *HackerNews) Initialize() error {
@ -31,7 +32,7 @@ func (widget *HackerNews) Initialize() error {
}
func (widget *HackerNews) Update(ctx context.Context) {
posts, err := feed.FetchHackerNewsTopPosts(40)
posts, err := feed.FetchHackerNewsTopPosts(40, widget.CommentsUrlTemplate)
if !widget.canContinueUpdateAfterHandlingErr(err) {
return