https://github.com/aaronlmathis/leetscraper
Simple web scraper that gets the leetcode problem of the day (or any problem by number)
https://github.com/aaronlmathis/leetscraper
Last synced: 7 months ago
JSON representation
Simple web scraper that gets the leetcode problem of the day (or any problem by number)
- Host: GitHub
- URL: https://github.com/aaronlmathis/leetscraper
- Owner: aaronlmathis
- License: gpl-3.0
- Created: 2025-03-28T13:35:47.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-28T13:42:59.000Z (over 1 year ago)
- Last Synced: 2025-03-28T14:34:39.295Z (over 1 year ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ๐ง LeetScraper
[](https://github.com/aaronlmathis/leetscraper/releases/latest)
**LeetScraper** is a command-line tool that fetches the [LeetCode](https://leetcode.com) Daily Challenge (or any specific problem) and saves it as well-formatted, language-specific source files โ complete with problem description, difficulty, and starter code.
> ๐ Open Source | ๐น Written in Go | ๐ GPL-3.0 Licensed
---
## โจ Features
- โ
Fetches **daily challenge** or specific problem by slug
- โ
Outputs clean, readable **source files** with problem description
- โ
Supports **multiple languages** (Go, Python, Java, Rust, etc.)
- โ
Fully configurable with `--flags` or `~/.leetscraper.json`
- โ
Clean CLI and **GitHub Actions-based release automation**
---
## ๐ฆ Installation
### ๐ณ Download prebuilt binary
Precompiled binaries are available inside archives for major platforms:
- **Linux (x86_64)**: [leetscraper-linux.tar.gz](https://github.com/aaronlmathis/leetscraper/releases/latest/download/leetscraper-linux.tar.gz)
- **macOS (arm64)**: [leetscraper-darwin.tar.gz](https://github.com/aaronlmathis/leetscraper/releases/latest/download/leetscraper-darwin.tar.gz)
- **Windows (x86_64)**: [leetscraper-windows.zip](https://github.com/aaronlmathis/leetscraper/releases/latest/download/leetscraper-windows.zip)
Or visit the [Releases page](https://github.com/aaronlmathis/leetscraper/releases) to download and verify checksums.
```sh
# Example (Linux):
curl -LO https://github.com/aaronlmathis/leetscraper/releases/latest/download/leetscraper-linux.tar.gz
tar -xzf leetscraper-linux.tar.gz
chmod +x leetscraper
./leetscraper --help
```
### ๐ Or build from source:
```bash
git clone https://github.com/aaronlmathis/leetscraper.git
cd leetscraper
make build
./dist/leetscraper --help
```
---
## ๐ Usage
### โค Daily Challenge (default)
Will default to pulling golang snippet, saving to working directory, using filename format: {id}-{difficulty}-{slug}.{ext} if .leetscraper.json is not present in home directory.
```bash
leetscraper
```
### โค Specific Problem by Slug
```bash
leetscraper --slug two-sum
```
### โค Custom Output Directory
```bash
leetscraper --out ~/leetcode/daily
```
### โค Multiple Languages
```bash
leetscraper --langs golang,python3,rust
```
### โค File Naming
```bash
leetscraper --format {id}-{difficulty}-{slug}.{ext}
```
---
## โ๏ธ Configuration
Set your preferences (optional) via .leetscraper.json saved to home directory.
See `leetscraper.json.sample` for example.
`~/.leetscraper.json`:
```json
{
"outputDir": "/home/you/leetcode",
"filenameFormat": "{id}-{difficulty}-{slug}.{ext}",
"languages": ["golang", "python3"]
}
```
Command-line flags will **override** config file values.
---
## ๐ Output Example
```text
123-easy-two-sum.go
123-easy-two-sum.py
123-easy-two-sum.rs
```
Each file includes:
- Problem title, difficulty, and link
- Full problem description (Markdown)
- Starter function in your language(s)
---
## ๐ง Development
```bash
make build # Build binary into dist/
make test # Run integration tests
make release # Cross-compile for release
make package # Create .tar.gz and .zip archives
```
---
## ๐งช Test Example
```bash
./test/test_leetscraper.sh
```
Or run as part of `make test`.
---
## ๐ License
**GPL-3.0-or-later**
ยฉ 2025 [Aaron Mathis](mailto:aaron.mathis@gmail.com)
---
## โญ๏ธ Star This Project
If this tool saves you time, consider [โญ starring the repo](https://github.com/aaronlmathis/leetscraper) โ it helps more developers discover it!