'Prevent Google from auto changing results language
I am trying to do google search from NodeJS using below code and trying to send it to whatsapp bot but that's irrelevant. The query string I am using is https://google.com/search?hl=en&q=
where I have set the language to English using hl=en
but since my server is in Germany, I am getting results in German language. Is there any way I can prevent it and get results in English?
let handler = async (m, { conn, command, args }) => {
let full = /f$/i.test(command)
let text = args.join` `
if (!text) return conn.reply(m.chat, 'There is no text to search', m)
let url = 'https://google.com/search?hl=en&q=' + encodeURIComponent(text)
let search = await googleIt({ query: text })
let msg = search.map(({ title, link, snippet }) => {
return `${title}\n_${link}\n${snippet}_`
}).join`\n\n`
m.reply(msg)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|