thebvog's blog

By thebvog, 10 years ago, translation, In English

With the addition of CodeForces API, ​​it made easier to implement the various ideas that previously could only be done through parsing. I wrote a small utility in Python. Originally it was written for conky and parsed list of contests, but now, I can divide the utility to CodeForces API class and conky output part. This utility can show future contests and user information with visual configuration. Who needs to display CodeForces information in conky or class to work with CodeForces API, I hope, it will be useful. Run:

conky.py [options]

Sample for conky configuration (update data every 30 minit):

${execpi 1800  python ~/cfclass/conky.py --next-contest-list --hr --colors}

Parameters:

  • --next-contest-list — show list of future contests with date

  • --user-info handle,...,handle — show user info for user in list

Class implementation:

from cfclass import CodeForces
cf = CodeForces()
result = cf.getContestList(gym=False)

With --color flag:

Without:

 .

  • Vote: I like it
  • +39
  • Vote: I do not like it