Skip to content

adi-g15/leetcode-progress-tracker

Repository files navigation

Leetcode Progress Tracker

Github Socialify

Netlify Status Update records

Track your daily progress on leetcode. Automate data collection. See a graph of your own, or of your friends together :D

Deployed at https://leetcode-progress.netlify.app/.

To use yourself:

  1. Edit data/watchlist.json to add your usernames
  2. Remove data/records.json to start from fresh

Usage

To update data/records.json, I would suggest simply activate the github action and git pull each time, or to update it yourself, run scripts/leetcode-watcher.js.

To see the frontend:

npm run start

Structure

├── .github/workflows
│   └── update.yml        // Github Action: Runs leetcode-watcher.js daily
├── global.css
├── index.html        // Main page for frontend
├── index.ts          // Main logic for graphing and other features in frontend
├── package.json
├── tsconfig.json
├── webpack.config.js
├── data
│   ├── records.json      // The JSON file containing daily record
│   └── watchlist.json    // Contains array of usernames to track/watch
├── LICENSE
├── README.md
└── scripts                 // Contains scripts for updating data in data/ folder
    ├── leetcode-watcher.js // Fetches count of problems done from leetcode
    ├── package.json
    └── script.sh           // Helper script for Github Action
  • The relevant code is in scripts/leetcode-watcher.js
  • The records are written to data/records.json
  • scripts/script.sh is provided to setup crontab on linux locally. Plus I will add some functions to it to help the github action too
  • A Github action will also maintain the records.json for names written on this repo's watchlist.json

Screenshot

Future

Story

Simple web scraping kaam nhi kiya... Phir Networks tab me requests dekha, graphql tha... usme request me cookie aur kya kya tha to sochha chhod deta hu ab... lekin bemtlb ka cheez hta ke Edit and Resend kaam kiya... to phir bas, kardiya implement :)

Bonus: Got another good link from https://leetcode.com/discuss/feedback/187751/is-there-an-api-call-to-get-number-of-problems-solved

https://leetcode.com/api/problems/algorithms/: Current user ke liye bhar bhar ke data return karta hai :)

Unlicense :)