Use limit query param in reddit widget
This commit is contained in:
parent
d7a17aab01
commit
9dde306c0c
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue