Use limit query param in reddit widget
This commit is contained in:
1 parent
d7a17aab01
commit
9dde306c0c
1 file changed
+5
@@ -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