mirror of
https://github.com/Xevion/glance.git
synced 2025-12-06 01:15:08 -06:00
Use limit query param in reddit widget
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@@ -184,6 +185,10 @@ func (widget *redditWidget) fetchSubredditPosts() (forumPostList, error) {
|
||||
}
|
||||
}
|
||||
|
||||
if widget.Limit > 25 {
|
||||
query.Set("limit", strconv.Itoa(widget.Limit))
|
||||
}
|
||||
|
||||
if widget.Search != "" {
|
||||
query.Set("q", widget.Search+" subreddit:"+widget.Subreddit)
|
||||
query.Set("sort", widget.SortBy)
|
||||
|
||||
Reference in New Issue
Block a user