Fully customizable Leetcode submission downloader and manager.

Leetdoad

Fully customizable Leetcode downloader and manager, which can download and organize your Leetcode submissions in different ways, e.g., by language, difficulty, question, etc.

Installation

go get github.com/jiachengxu/leetdoad

Alternatively, you can download the latest release from release page.

You can check the available flags by:

$ leetdoad -h
Usage of leetdoad:
  -config-file string
    	Path of the leetdoad config file (default ".leetdoad.yaml")
  -cookie string
    	Cookie that used for scraping problems and solutions from Leetcode website, you can either pass it from here, or set LEETCODE_COOKIE env
  -debug
    	Debug logs
  -version
    	Show the current leetdoad version

Leetdoad uses a cookie to download your latest submissions from Leetcode, and cookie can be found in your browser when you visit Leetcode website. If you don't know how to find the cookie, Google is your friend. When you have your cookie in-place, you can either pass it via -cookie flag or set it to the LEETCODE_COOKIE environment variable.

Leetdoad also requires a configuration file in YAML to organize your Leetcode submissions locally, you can either create a file, and pass it via -config-file flag or name it as .leetdoad.yaml in the folder, leetdoad will use it by default.

Configuration

# Languages defines the submissions you would like to download are written in which programming languages.
# Currently, supported values are: bash, c, cpp, golang, java, javascript, python, python3, rust, ruby, scala, swift.
# Also, it supports a special value "*", which means all above programming languages.
languages: [golang, java, cpp, python3]
# Pattern is the naming pattern for your submission file path. It has to be compatible with go template.
# Available Options:
#   - .Difficulty - The difficulty of the question.
#   - .Language - The language that the submission is written in.
#   - .QuestionName - The question name.
#   - .QuestionNumber - The question number.
# Note that you don't need to specify the extension of the submission file because that will be automatically added based on the
# programming language that the submission is written in.
# For example, with the following pattern, your go and java solutions of 1.Two Sum question will be saved as:
# <current_dir>/go/1.two-sum.easy.go
# <current_dir>/java/1.two-sum.easy.go
# Note that you don't have to including all the above options in the pattern definition. 
pattern: "{{ .Language }}/{{ .QuestionNumber }}.{{ .QuestionName }}.{{ .Difficulty }}"

Examples

If you are interested in how I organize my Leetcode submissions with Leetdoad, please check my leetcode solutions.

Let's consider the following simple example, you have solved the following Leetcode questions:

QuestionNumber QuestionName Difficulty Language
1 Two Sum easy cpp, golang
2 Add Two Numbers medium golang, java

Basic

language: ["*"]
pattern: "{{ .QuestionNumber }}.{{ .QuestionName }}"
.
|-- 1.two-sum.cpp
|-- 1.two-sum.go
|-- 2.add-two-numbers.go
|-- 2.add-two-numbers.java

Organized by Questions

language: ["*"]
pattern: "{{ .QuestionNumber }}.{{ .QuestionName }}/solution"
.
|-- 1.two-sum
|   |-- solution.cpp
|   |-- solution.go
|-- 2.add-two-numbers
|   |-- solution.go
|   |-- solution.java

Organized by Difficulties

language: [golang, cpp]
pattern: "{{ .Difficulty }}/{{ .QuestionName }}"
.
|-- easy
|   |-- two-sum.cpp
|   |-- two-sum.go
|-- medium
|   |-- add-two-numbers.go

Organized by Languages

language: [golang, java]
pattern: "{{ .Language }}/{{ .QuestionName }}-{{ .Difficulty }}"
.
|-- golang
|   |-- two-sum-easy.go
|   |-- add-two-numbers-medium.go
|-- java
|   |-- add-two-numbers-medium.java

Limitations

Leetdoad scrapes submissions relatively slow. In my case, it always takes around 20 minutes to downland submissions of my ~400 solved questions. The bottleneck is not about the implementation of Leetdoad, and it is because the Leetcode API has rate-limiting configured.

Owner
Jiacheng Xu
Gopher. Open source lover. Speedcuber. Bodybuilder.
Jiacheng Xu
Similar Resources

Learning and Practice - Go Lang

Go Lang - Learning and Practice All the code stored here is provided by Tour of Go Basics Packages, variables, and functions Flow control statements:

Jan 14, 2022

Comparison of Pixel and Ebiten API on the trees tutorial

Rewriting the trees tutorial of Pixel with Ebiten for API comparison I tried Pixel and really liked the clean API but the dev seems to be on pause sin

Dec 7, 2021

Example skills and a cli utility written in Go for interacting with Webex Assistant Skills

Webex Assistant Skills - Go This repository holds example skills and a cli utility written in Go for interacting with Webex Assistant Skills. It is in

Oct 29, 2021

Cook amazing genetic parts using our cookbook. Recipes and synthetic biology tools to take your breath away.

friendzymes-cookbook Friendly tools for a friendly community. A collection of tutorials and genetic tools for synthetic biology. This cookbook is a su

Aug 19, 2022

A go blog demo by gin and gorm!

A go blog demo by gin and gorm!

Dec 7, 2022

This is an example of a keep-it-simple directory layout for Go projects that was created using DDD principles, please copy and share if you like it.

DDD Go Template This project was created to illustrate a great architectural structure I developed together with @fabiorodrigues in the period I was w

Dec 5, 2022

I will be uploading some basic programming in Golang so if you want to contribute please Fork this repo and contriute.

I will be uploading some basic programming in Golang so if you want to contribute please Fork this repo and contriute.

Go-language I will be uploading some basic programming in Golang so if you want to contribute please Fork this repo and contriute. This repo is for pr

Jan 21, 2022

Simple boilerplate code to get started with building and deploying a serverless CRUD API

Simple boilerplate code to get started with building and deploying a serverless CRUD API with Go, MongoDB and Netlify

Jan 20, 2022

How to work with channels, goroutines, tickers, mutexes and context cancelation

Concurrency tasks This page holds 4 concurrency practical tasks to help you to understand how to write concurrent code. They will help you to understa

Nov 9, 2021
Tool (in Go!) to compare and diff container and host environments. Dinosaur fun!

Compe compare environments and other things between containers, and host ??️ This is a simple tool to compare environments and other features of conta

Sep 24, 2022
Go Cheat Sheet - An overview of Go syntax and features.

Go Cheat Sheet - An overview of Go syntax and features.

Dec 31, 2022
An online book focusing on Go syntax/semantics and runtime related things

Go 101 is a book focusing on Go syntax/semantics and all kinds of runtime related things. It tries to help gophers gain a deep and thorough understanding of Go. This book also collects many details of Go and in Go programming. The book is expected to be helpful for both beginner and experienced Go programmers.

Dec 29, 2022
This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney

This slide deck and supporting material is part of the Introduction to Go training course by Dave Cheney.

Nov 14, 2022
📖 Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.
📖 Build a RESTful API on Go: Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers.

?? Tutorial: Build a RESTful API on Go Fiber, PostgreSQL, JWT and Swagger docs in isolated Docker containers. ?? The full article is published on Marc

Dec 27, 2022
Assert your Go code is inlined and bounds-check eliminated

gcassert gcassert is a program for making assertions about compiler decisions in Golang programs, via inline comment directives like //gcassert:inline

Oct 27, 2022
1000+ Hand-Crafted Go Examples, Exercises, and Quizzes

A Huge Number of Go Examples, Exercises and Quizzes Best way of learning is doing. Inside this repository, you will find thousands of Go examples, exe

Jan 1, 2023
Official provider for VMware desktop products: Fusion, Player, and Workstation.

Vagrant VMware Desktop Providers This is the common codebase for the official providers for VMware desktop products: Fusion, Player, and Workstation.

Jan 7, 2023
A complete guide to undersatnd golang programming language, web requests, JSON and creating web APIs with mongodb

Golang series A complete guide to undersatnd golang programming language, web requests, JSON and creating web APIs with mongodb LearnCodeonline.in 01

Jan 1, 2023
Golang Clean Architecture based on Uncle Bob's Clean Architecture and Summer internship in 2021

clean-architecture-api Description This is an example of implemention of Clean Architecture in Golang projects. This project has 4 layer : Infrastruct

Feb 20, 2022