forked from Ponysearch/Ponysearch
[fix] currency converter - valid date url param
This commit is contained in:
parent
b9ebf18f59
commit
1240be48fb
1 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
categories = []
|
categories = []
|
||||||
url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
|
url = 'http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
|
||||||
|
@ -40,7 +41,13 @@ def response(resp):
|
||||||
)
|
)
|
||||||
|
|
||||||
content = '1 {0} is {1} {2}'.format(resp.search_params['from'], conversion_rate, resp.search_params['to'])
|
content = '1 {0} is {1} {2}'.format(resp.search_params['from'], conversion_rate, resp.search_params['to'])
|
||||||
url = 'http://finance.yahoo.com/currency/converter-results/20131104/{0}-{1}-to-{2}.html'.format(resp.search_params['ammount'], resp.search_params['from'].lower(), resp.search_params['to'].lower())
|
now_date = datetime.now().strftime('%Y%m%d')
|
||||||
|
url = 'http://finance.yahoo.com/currency/converter-results/{0}/{1}-{2}-to-{3}.html'
|
||||||
|
url = url.format(now_date
|
||||||
|
,resp.search_params['ammount']
|
||||||
|
,resp.search_params['from'].lower()
|
||||||
|
,resp.search_params['to'].lower()
|
||||||
|
)
|
||||||
results.append({'title': title, 'content': content, 'url': url})
|
results.append({'title': title, 'content': content, 'url': url})
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
Loading…
Reference in a new issue