summaryrefslogtreecommitdiff
path: root/searx/engines/duckduckgo_definitions.py
diff options
context:
space:
mode:
authorasciimoo <asciimoo@gmail.com>2013-10-23 23:55:37 +0200
committerasciimoo <asciimoo@gmail.com>2013-10-23 23:55:37 +0200
commit74b6be3991dc62577aca295de839e51e6d0807d6 (patch)
tree5bf5df160e765dc7dc6897e640fd23a761df1d2e /searx/engines/duckduckgo_definitions.py
parent39d229e1104dc10c7c7f00380c02d46118e3d895 (diff)
downloadsearxng-74b6be3991dc62577aca295de839e51e6d0807d6.tar.gz
searxng-74b6be3991dc62577aca295de839e51e6d0807d6.zip
[enh] engine cfg compatibilty
Diffstat (limited to 'searx/engines/duckduckgo_definitions.py')
-rw-r--r--searx/engines/duckduckgo_definitions.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/searx/engines/duckduckgo_definitions.py b/searx/engines/duckduckgo_definitions.py
index 531b53ccc..2b180d0ff 100644
--- a/searx/engines/duckduckgo_definitions.py
+++ b/searx/engines/duckduckgo_definitions.py
@@ -1,7 +1,10 @@
import json
+from urllib import urlencode
+
+url = 'http://api.duckduckgo.com/?{query}&format=json&pretty=0'
def request(query, params):
- params['url'] = 'http://api.duckduckgo.com/?q=%s&format=json&pretty=0' % query
+ params['url'] = url.format(query=urlencode({'q': query}))
return params