Commit 0203737b authored by Gaël Duval's avatar Gaël Duval 🏄🏼

Merge branch 'google-results' into 'master'

Put google results on top

See merge request !27
parents 471ec05f 8c1b16fa
......@@ -130,9 +130,10 @@ def duckduckgo(query, lang):
# duckduckgo autocompleter
url = 'https://ac.duckduckgo.com/ac/?{0}&type=list'
resp = loads(get(url.format(urlencode(dict(q=query)))).text)
if len(resp) > 1:
return resp[1]
resp = get(url.format(urlencode(dict(q=query))))
if resp.status_code == 200 and resp.text:
res = loads(resp.text)
return res[1] if len(res) == 2 else []
return []
......
......@@ -283,10 +283,12 @@ engines:
- name : google
engine : google
shortcut : go
weight : 5
- name : google images
engine : google_images
shortcut : goi
disabled: True
- name : google news
engine : google_news
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment