Skip to content

bsheth711/LeetCodeExtract

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetcodeExtract

A Node.js project that extracts Leetcode submissions and pushes them to a repository. See an example repository.

Requirements

  • Node.js 20+
  • Bash

How To Setup

  1. Get Leetcode tokens from your Leetcode cookie.
    The easiest way to do this is by opening your browser's inspect mode and loading a page while signed into Leetcode. Then, switch to the network tab and choose a request that is being sent to Leetcode, such as a graphql request. In the headers for the request Headers section, you will find a Cookie containing your "LEETCODE_SESSION" and "csrftoken". Do not share these tokens with anybody. tokens
  2. Save tokens in a json file.
    Save the tokens in a in a json file with the following format:
{
	"LEETCODE_SESSION": "...",
	"csrftoken": "..."
}
  1. Set the environment variable LEETCODE_CREDENTIALS_PATH to the path to the file.

  2. Create a remote repository to push to. Set the variable githubRepo in the bash script run.sh.

githubRepo="..." # <-- your github repo ssh URL

Note: Occasionally you will need to get fresh tokens and replace the ones in your tokens file.

How To Run

Run the following command from your Bash terminal:

npm start

TODO

Add file extension support for all Leetcode languages

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published