fix .google unicode query handling

This commit is contained in:
Ryan Hitchman 2009-12-22 15:54:30 -07:00
parent a92e02f4d8
commit 81ca14fcf0
1 changed files with 1 additions and 0 deletions

View File

@ -9,6 +9,7 @@ from util import hook
def api_get(kind, query):
req_url = 'http://ajax.googleapis.com/ajax/services/search/%s?' \
'v=1.0&safe=off&q=%s'
query = query.encode('utf8')
url = req_url % (kind, urllib.quote(query, safe=''))
page = urllib.urlopen(url).read()
return json.loads(page)