actually fix search module
parent
8a33dabb3e
commit
fdf53d578f
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue