Skip to content

Generate a nicely formatted leetcode solution of a developer from his profile and also fetch articles if he submitted in the solution.

License

Notifications You must be signed in to change notification settings

chapimenge3/leetcode-profiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode-profiler

Generate a nicely formatted leetcode solution of a developer from his profile and also fetch articles if he submitted in the solution.

Installation

git clone https://github.com/chapimenge3/leetcode-profiler

Usage

Before using it we need to provide LEETCODE SESSION.

How to get LEETCODE SESSION

  1. Login to leetcode

  2. Open developer tools(F12 or right click and inspect)

  3. Go to Application tab(Chrome) or Storage tab(Firefox)

  4. Click on Cookies > https://leetcode.com

  5. Copy the value of LEETCODE_SESSION

  6. run this command in the current terminal

    export LEETCODE_SESSION=<value>
  7. Now you can use the script using

    python3 main.py

NOTE: As of now the script only works if you provide the LEETCODE_SESSION in the same terminal. If you close the terminal you need to provide the LEETCODE_SESSION again.

You can also export the username and password as well.

export LEETCODE_USERNAME=<username>
export LEETCODE_PASSWORD=<password>

One last environment is logging. The default logging level is INFO. You can change it to DEBUG if you want to see the debug logs.

export LOG_LEVEL=DEBUG

Demo

You can find the demo Generated files in here or click chapi folder in the root directory.

The folder structure is as follows

├── username
|   ├── README.md
|   ├── solutions
|   |   ├── question
|   |   |   ├── solution.py
|   |   |   ├── README.md
|   |   |   ├── article.md(TODO)

Known Issues

  • Login the user using username and password
  • Fetching the articles and adding it to the solution

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Generate a nicely formatted leetcode solution of a developer from his profile and also fetch articles if he submitted in the solution.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published