xalanq / cf-tool

:bar_chart: Codeforces CLI (Submit, Parse, Test, etc.). Support Contests, Gym, Groups, acmsguru, Windows, macOS, Linux, 7 MB
MIT License
1.32k stars 227 forks source link

Parse countdown timer using CF API in cf race #75

Closed infalmo closed 4 years ago

infalmo commented 4 years ago

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:

image

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.

You may view the API details here : https://codeforces.com/apiHelp/methods#contest.list

infalmo commented 4 years ago

Nvm, this option is not viable. Virtual contests won't be supported by this feature