mirror of
https://github.com/Xevion/glance.git
synced 2025-12-08 12:07:16 -06:00
Use limit query param in reddit widget
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
|||||||
"html/template"
|
"html/template"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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 != "" {
|
if widget.Search != "" {
|
||||||
query.Set("q", widget.Search+" subreddit:"+widget.Subreddit)
|
query.Set("q", widget.Search+" subreddit:"+widget.Subreddit)
|
||||||
query.Set("sort", widget.SortBy)
|
query.Set("sort", widget.SortBy)
|
||||||
|
|||||||
Reference in New Issue
Block a user