Instead of scraping the webpage to find the countdown on executing cf race, you can use the CF API to parse the time till contest start.
Making an API call to https://codeforces.com/api/contest.list yields:
This also brings another suggestion : Merge parse and race into 1 command (using parse command for both). Till the contest starts (skip if contest is over) run the countdown. Then parse as usual.
Instead of scraping the webpage to find the countdown on executing
cf race
, you can use the CF API to parse the time till contest start. Making an API call to https://codeforces.com/api/contest.list yields:This also brings another suggestion : Merge
parse
andrace
into 1 command (using parse command for both). Till the contest starts (skip if contest is over) run the countdown. Then parse as usual.You may view the API details here : https://codeforces.com/apiHelp/methods#contest.list