Skip to content

Commit

Permalink
make google search page always use english
Browse files Browse the repository at this point in the history
  • Loading branch information
xyb committed Mar 17, 2022
1 parent 903e4b2 commit c599f5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/googlesearch.nim
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type

const
USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/76.0.3809.100 Safari/537.36"
SEARCH_URL = "https://google.com/search"
SEARCH_URL = "https://google.com/search?hl=en"

proc newProxyHttpClient(): HttpClient =
var proxyUrl = ""
Expand Down Expand Up @@ -52,7 +52,7 @@ proc newProxyHttpClient(): HttpClient =
proc queryHtml(query: string, start = 0): string =
var client = newProxyHttpClient()
let q = encodeQuery({"q": query, "start": $start})
let url = SEARCH_URL & "?" & q
let url = SEARCH_URL & "&" & q
result = client.getContent(url)

iterator search*(query: string, maxResults = 10): SearchResult =
Expand Down

0 comments on commit c599f5c

Please sign in to comment.