From 01fea4666f673c3cdaa71a76aafc5f04b8d44d39 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Sun, 6 Mar 2016 14:38:14 -0800 Subject: [PATCH] search: use https for bing, duckduckgo, and google --- modules/search.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/search.py b/modules/search.py index 18c4b55..a8c8338 100644 --- a/modules/search.py +++ b/modules/search.py @@ -14,7 +14,7 @@ def google_ajax(query): """Search using AjaxSearch, and return its JSON.""" if isinstance(query, str): query = query.encode('utf-8') - uri = 'http://ajax.googleapis.com/ajax/services/search/web' + uri = 'https://ajax.googleapis.com/ajax/services/search/web' args = '?v=1.0&safe=off&q=' + web.quote(query) bytes = web.get(uri + args, headers={'Referer': 'https://github.com/sbp/phenny'}) return web.json(bytes) @@ -100,7 +100,7 @@ r_bing = re.compile(r'

') def duck_search(query): query = query.replace('!', '') query = web.quote(query) - uri = 'http://duckduckgo.com/html/?q=%s&kl=uk-en' % query + uri = 'https://duckduckgo.com/html/?q=%s&kl=uk-en' % query bytes = web.get(uri) m = r_duck.search(bytes) if m: return web.decode(m.group(1))