This commit is contained in:
cube
2026-05-30 20:52:47 +01:00
parent db3449fcea
commit 4396e0758e
4 changed files with 86 additions and 38 deletions

View File

@@ -3,15 +3,21 @@ import time
stats = LiveStats()
# if there are live races...
if len(stats.races) > 0:
race = stats.races[0]
race = stats.races[0] # just grab the first one for example's sake
print("Latest timeline update from", race.title, ":")
# keep the last update so we don't spam the terminal
last_update = ""
while True:
race.get_timeline()
# only update terminal if the newest item has changed (is new)
if last_update != race.timeline[0]:
print(race.timeline[0])
last_update = race.timeline[0]
# wait ten seconds before checking again
# maybe set to longer if running for extended time
time.sleep(10)