Tidy up Coins
This commit is contained in:
parent
93b97c99c4
commit
38e571000e
|
@ -24,10 +24,9 @@ class Coins(Plugin):
|
|||
%%btc
|
||||
"""
|
||||
data = requests.get('https://www.bitstamp.net/api/ticker').json()
|
||||
return fmt('{bold}[BitStamp, 24h]{reset} '
|
||||
values = {k: float(data[k]) for k in ['last', 'high', 'low', 'volume']}
|
||||
return fmt('{bold}[BitStamp]{reset} '
|
||||
'Current: {bold}{color}{orange}${last:,.2f}{reset} - '
|
||||
'High: {bold}{color}{green}${high:,.2f}{reset} - '
|
||||
'Low: {bold}{color}{maroon}${low:,.2f}{reset} - '
|
||||
'Volume: {bold}฿{volume:,.2f}',
|
||||
last=float(data['last']), high=float(data['high']),
|
||||
low=float(data['low']), volume=float(data['volume']))
|
||||
'Volume: {bold}฿{volume:,.2f}', **values)
|
||||
|
|
Loading…
Reference in New Issue
Block a user