A utility to log a user's submissions on Codeforces to a Google Sheet.
The aim of this project is to analyse and track a user's progress on Codeforces, in specific and Competitve Programming, in general through his/her submissions. This is achieved by fetching recent submissions of the given user and inserting the submission data to a specified Google Sheet. The data is updated at regular intervals of time.
On a personal front, I have made this to sort of automate things for me as I wish to reflect on the problems I solve during practice and on my performances in contests on Codeforces. I chose Google Sheets as the platform as I can easily access and edit the content there and it also provides options for filtering, sorting and visualising the data.
In the future, if things go well I plan to handle team submissions separately, provide facility for fetching unofficial submissions and extend this idea to other Online Judges as well. Of course, contributions and feedback from the community are always welcome.
This project is built on node.js. Install it from here.
Clone the repository to your local machine by using the below command in your terminal:
$ git clone https://github.com/hemant2132/codeforces-submissions-logger
- Having cloned the copy to your local machine, enter into the project directory.
$ cd codeforces-submissions-logger
Create a spreadsheet on Google Sheets by following the steps given here.
Enter these fields in the header row:
Timestamp, Problem Link, Contest ID, Index, Name, Rating, Tags, Submission Link, Programming Language, Submission Verdict, Passed Test Count, Time Consumption, Memory Consumption, Points, Participation Type.
It is recommended to keep all of these header values in your sheet, especially "Submission Link". Although you may skip or hide some of them in your worksheet. Also, you can arrange them in any order.
The project uses google-spreadsheet, which is a Google Sheets API (v4) wrapper for Node.js, for writing data to Google Sheets. It requires some level of authentication to make requests.
This project works with the service account-based-approach. Follow the steps given here.
For the environment variables, create a .env file in the root folder.
The environment variables required are:
CODEFORCES_HANDLE
: The codeforces handle of the user whose submissions need to be tracked.TIME_INTERVAL
: The time interval after which a request will be made to fetch recent submissions (in milliseconds).TIME_BASE_VALUE
: The amount of time with which the time interval varies depending on whether new submissions were inserted into the sheet (in milliseconds).TIME_MAX_VALUE
: The maximum possible value for the time interval (in milliseconds).GOOGLE_SHEET_ID
: The long ID in the url of the Google sheet you wish to useTIME_ZONE
: The time zone you want to follow for the dates. See the whole list here.GOOGLE_SERVICE_ACCOUNT_EMAIL
: The email id of the service account.GOOGLE_PRIVATE_KEY
: The private key of the service account.
- Run the following commands from the terminal.
npm i
npm start
- A "running" message will soon show up on the console. Congratulations, the setup is now complete.
Since a Google Sheet has been used, you have all the options you can find in any other Google Sheet. You can filter the submissions by contest ID, problem index, tags, rating, participation type etc., sort the columns, visualise the data using charts, customise your sheet, make edits wherever you want, take notes and much more.
This project is licensed under the terms of the MIT license.