Add pages for search

This commit is contained in:
video-prize-ranch
2023-08-10 16:00:42 +00:00
parent 043150d85b
commit 498e9282e9
3 changed files with 20 additions and 10 deletions

View File

@@ -21,9 +21,9 @@ type SearchResult struct {
RelTime string
}
func (client *Client) Search(query string) ([]SearchResult, error) {
func (client *Client) Search(query string, page string) ([]SearchResult, error) {
query = url.QueryEscape(query)
req, err := http.NewRequest("GET", "https://imgur.com/search?qs=list&q=" + query, nil)
req, err := http.NewRequest("GET", "https://imgur.com/search/all/page/" + page + "?scrolled&q_size_is_mpx=off&qs=list&q=" + query, nil)
if err != nil {
return []SearchResult{}, err
}