Preparing history graph
This commit is contained in:
parent
954ed088cc
commit
c0a59e4c69
1 changed files with 4 additions and 3 deletions
|
@ -42,9 +42,8 @@ def compute(args: argparse.Namespace) -> str:
|
||||||
round_nb = args.round
|
round_nb = args.round
|
||||||
|
|
||||||
req = requests.get(
|
req = requests.get(
|
||||||
"https://api.coinranking.com/v1/public/coins?base={}&symbols={}".format(
|
"https://api.coinranking.com/v1/public/coins"
|
||||||
base, coin
|
"?base={}&symbols={}&timePeriod=30d".format(base, coin)
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -57,6 +56,8 @@ def compute(args: argparse.Namespace) -> str:
|
||||||
base_sign = data["base"]["sign"]
|
base_sign = data["base"]["sign"]
|
||||||
coin_data = data["coins"][0]
|
coin_data = data["coins"][0]
|
||||||
price = float(coin_data["price"])
|
price = float(coin_data["price"])
|
||||||
|
history = coin_data["history"]
|
||||||
|
print(history)
|
||||||
|
|
||||||
output = "{} = {}{}".format(coin, base_sign, round(price, round_nb))
|
output = "{} = {}{}".format(coin, base_sign, round(price, round_nb))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue