Preparing history graph

This commit is contained in:
flyingscorpio@arch-desktop 2020-05-16 20:01:36 +02:00
parent 954ed088cc
commit c0a59e4c69

View file

@ -42,9 +42,8 @@ def compute(args: argparse.Namespace) -> str:
round_nb = args.round
req = requests.get(
"https://api.coinranking.com/v1/public/coins?base={}&symbols={}".format(
base, coin
)
"https://api.coinranking.com/v1/public/coins"
"?base={}&symbols={}&timePeriod=30d".format(base, coin)
)
try:
@ -57,6 +56,8 @@ def compute(args: argparse.Namespace) -> str:
base_sign = data["base"]["sign"]
coin_data = data["coins"][0]
price = float(coin_data["price"])
history = coin_data["history"]
print(history)
output = "{} = {}{}".format(coin, base_sign, round(price, round_nb))