diff options
author | Dalf <alex@al-f.net> | 2014-09-28 16:51:41 +0200 |
---|---|---|
committer | Dalf <alex@al-f.net> | 2014-09-28 16:51:41 +0200 |
commit | 6bfd5663539052a64c984f5bdb7135d0d652c923 (patch) | |
tree | acf2049046d62c0b4849d0b36815dfe21117bcec /searx/engines/currency_convert.py | |
parent | e39d9fe5423a0fceed1d15dc63c1f8aa30d72e44 (diff) | |
download | searxng-6bfd5663539052a64c984f5bdb7135d0d652c923.tar.gz searxng-6bfd5663539052a64c984f5bdb7135d0d652c923.zip |
[enh] add infoboxes and answers
Diffstat (limited to 'searx/engines/currency_convert.py')
-rw-r--r-- | searx/engines/currency_convert.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/searx/engines/currency_convert.py b/searx/engines/currency_convert.py index 561527bce..b5f0953d8 100644 --- a/searx/engines/currency_convert.py +++ b/searx/engines/currency_convert.py @@ -38,16 +38,14 @@ def response(resp): except: return results - title = '{0} {1} in {2} is {3}'.format( + answer = '{0} {1} = {2} {3} (1 {1} = {4} {3})'.format( resp.search_params['ammount'], resp.search_params['from'], + resp.search_params['ammount'] * conversion_rate, resp.search_params['to'], - resp.search_params['ammount'] * conversion_rate + conversion_rate ) - content = '1 {0} is {1} {2}'.format(resp.search_params['from'], - conversion_rate, - resp.search_params['to']) now_date = datetime.now().strftime('%Y%m%d') url = 'http://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html' # noqa url = url.format( @@ -56,6 +54,7 @@ def response(resp): resp.search_params['from'].lower(), resp.search_params['to'].lower() ) - results.append({'title': title, 'content': content, 'url': url}) + + results.append({'answer' : answer, 'url': url}) return results |