New .tr syntax for translations

This commit is contained in:
Sean B. Palmer
2012-01-11 14:18:34 +00:00
parent b2fe5b31e2
commit e3633957a9
3 changed files with 49 additions and 2 deletions

View File

@@ -20,6 +20,8 @@ class Grab(web.urllib.URLopener):
def google_ajax(query):
"""Search using AjaxSearch, and return its JSON."""
if isinstance(query, unicode):
query = query.encode('utf-8')
uri = 'http://ajax.googleapis.com/ajax/services/search/web'
args = '?v=1.0&safe=off&q=' + web.urllib.quote(query)
handler = web.urllib._urlopener