diff options
author | Dalf <alex@al-f.net> | 2014-01-05 13:58:17 +0100 |
---|---|---|
committer | Dalf <alex@al-f.net> | 2014-01-05 13:58:17 +0100 |
commit | bf56ec4fb1199ab46feeacb8a045d28b287baf47 (patch) | |
tree | 072296037bb52f8deae26e2f64b338fa8b50bd7c /searx | |
parent | 49c85fce51c2b8431013d9269999eac5a6a9c038 (diff) | |
download | searxng-bf56ec4fb1199ab46feeacb8a045d28b287baf47.tar.gz searxng-bf56ec4fb1199ab46feeacb8a045d28b287baf47.zip |
[mod] bing and duckduckgo engines : add / rename locale parameter
Diffstat (limited to 'searx')
-rw-r--r-- | searx/engines/bing.py | 4 | ||||
-rw-r--r-- | searx/engines/duckduckgo.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/searx/engines/bing.py b/searx/engines/bing.py index 1002a29c6..6b0bf5a3f 100644 --- a/searx/engines/bing.py +++ b/searx/engines/bing.py @@ -4,11 +4,11 @@ from cgi import escape base_url = 'http://www.bing.com/' search_string = 'search?{query}' -language = 'en-us' # see http://msdn.microsoft.com/en-us/library/dd251064.aspx +locale = 'en-US' # see http://msdn.microsoft.com/en-us/library/dd251064.aspx def request(query, params): - search_path = search_string.format(query=urlencode({'q': query, 'setmkt': language})) + search_path = search_string.format(query=urlencode({'q': query, 'setmkt': locale})) #if params['category'] == 'images': # params['url'] = base_url + 'images/' + search_path params['url'] = base_url + search_path diff --git a/searx/engines/duckduckgo.py b/searx/engines/duckduckgo.py index d591854a5..4bf770972 100644 --- a/searx/engines/duckduckgo.py +++ b/searx/engines/duckduckgo.py @@ -3,10 +3,11 @@ from urllib import urlencode from searx.utils import html_to_text url = 'https://duckduckgo.com/' -search_url = url + 'd.js?{query}&l=us-en&p=1&s=0' +search_url = url + 'd.js?{query}&p=1&s=0' +locale = 'us-en' def request(query, params): - params['url'] = search_url.format(query=urlencode({'q': query})) + params['url'] = search_url.format(query=urlencode({'q': query, 'l': locale})) return params |