Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

CodeForces-tools-

Useful tools for Codeforces users(On the macOS)


Codeforces Submission Monitor (macOS)

A lightweight Python script that monitors your friends' Codeforces submissions in real-time. It sends instant macOS notifications and plays system sounds whenever a friend submits a solution.

Features

  • Real-time Monitoring: Automatically polls the Codeforces API at a configurable interval.
  • Native macOS Alerts: Uses osascript for pop-up notifications and afplay for system sounds.
  • Customizable Settings:
    • Adjustable check frequency (in seconds).
    • Multiple sound options (Ping, Glass, Hero, Funk, etc.).
  • Detailed Logs: Prints problem name, verdict, and timestamp directly to your terminal.

Prerequisites

  • Operating System: macOS (required for native sound/notification features)
  • Python: Version 3.6+
  • Library: requests

Install the required library:

pip install requests

Usage

  1. Save the script code into a file named cf_monitor.py.

  2. Run the script via your terminal:

    python3 cf_monitor.py
  3. Follow the Prompts:

    • Enter your own Codeforces handle.
    • Enter the list of friends' handles separated by commas (e.g., tourist,petr,ecnal-kcm).
    • Set the checking interval (default is 60 seconds).
    • Select a preferred notification sound.

How It Works

  1. Initialization: Upon starting, the script fetches the latest 5 submissions from each friend to "sync" history. This ensures you are only alerted about future submissions, not old ones.
  2. Loop: It runs an infinite loop, sleeping for the defined interval between checks.
  3. Alert Trigger: If a new submission ID is found, it triggers the sound, pushes the macOS notification, and prints the info to the console.

Press Ctrl+C at any time to stop the monitor gracefully.

License & Disclaimer

This tool uses the public Codeforces API. Please respect their rate limits (this script is designed to be lightweight). Free to use and modify.

About

Useful tools for Codeforces users(On the macOS)

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages