actually fix search module

master
mutantmonkey 2012-02-10 21:13:43 -05:00
parent 8a33dabb3e
commit fdf53d578f
1 changed files with 4 additions and 4 deletions

View File

@ -23,11 +23,11 @@ def google_ajax(query):
if isinstance(query, str): if isinstance(query, str):
query = query.encode('utf-8') query = query.encode('utf-8')
uri = 'http://ajax.googleapis.com/ajax/services/search/web' uri = 'http://ajax.googleapis.com/ajax/services/search/web'
args = '?v=1.0&safe=off&q=' + web.urllib.quote(query) args = '?v=1.0&safe=off&q=' + web.quote(query)
handler = web.urllib._urlopener handler = web.urllib.request._urlopener
web.urllib._urlopener = Grab() web.urllib.request._urlopener = Grab()
bytes = web.get(uri + args) bytes = web.get(uri + args)
web.urllib._urlopener = handler web.urllib.request._urlopener = handler
return web.json(bytes) return web.json(bytes)
def google_search(query): def google_search(query):