mirror of
https://github.com/glanceapp/glance.git
synced 2025-08-09 07:44:59 +02:00
Allow using alternative links for YT, HN and reddit
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user