@@ -18,16 +18,12 @@ base_url = 'http://api.wolframalpha.com/v2/query'
1818search_url = base_url + '?appid={api_key}&{query}&format=plaintext'
1919site_url = 'http://wolframalpha.com/input/?{query}'
2020
21−#embedded_url = '<iframe width="540" height="304" ' +\
22−# 'data-src="//www.youtube-nocookie.com/embed/{videoid}" ' +\
23−# 'frameborder="0" allowfullscreen></iframe>'
24−
2521# do search-request
2622def request(query, params):
2723 params['url'] = search_url.format(query=urlencode({'input': query}),
2824 api_key=api_key)
2925
30− # need this for url in response
26+ need this for url in response
3127 global my_query
3228 my_query = query
3329
@@ -63,8 +59,9 @@ def response(resp):
6359 result_url = site_url.format(query=urlencode({'i': my_query}))
6460
6561 # append result
62+ # TODO: shouldn't it bind the source too?
6663 results.append({'url': result_url,
67− 'title': result})
64+ 'answer': result})
6865
6966 # return results
7067 return results