mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2025-07-17 16:48:24 +00:00
Query escape search query
This commit is contained in:
parent
52ae1fc9d5
commit
5dc95f4470
@ -3,6 +3,7 @@ package api
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"codeberg.org/rimgo/rimgo/utils"
|
||||
@ -19,6 +20,7 @@ type SearchResult struct {
|
||||
}
|
||||
|
||||
func (client *Client) Search(query string) ([]SearchResult, error) {
|
||||
query = url.QueryEscape(query)
|
||||
req, err := http.NewRequest("GET", "https://imgur.com/search?q=" + query, nil)
|
||||
if err != nil {
|
||||
return []SearchResult{}, err
|
||||
|
Loading…
Reference in New Issue
Block a user