Skip to content

Commit 59cb5fa

Browse files
authored
Update README.md
1 parent eb9246a commit 59cb5fa

File tree

1 file changed

+0
-0
lines changed

1 file changed

+0
-0
lines changed

β€ŽREADME.mdβ€Ž

2.71 KB

leetcode-daily-mailer

# πŸ“¬ LeetCode Daily Challenge Email Bot

Automatically receive the **LeetCode Daily Coding Challenge** in your email inbox every day at **8:00 AM IST** using **GitHub Actions**.

No servers or paid services required β€” just GitHub + Gmail!

---

## πŸš€ Features

- πŸ“Œ Automatically fetches LeetCode's Daily Challenge using their GraphQL API
- πŸ“§ Sends a nicely formatted email to your inbox
- ⏰ Fully automated using GitHub Actions (`cron`) β€” runs **daily**
- πŸ” Keeps your credentials secure using GitHub Secrets

---

## πŸ› οΈ How It Works

This project uses:
- A Python script (`daily_leetcode.py`) to:
  - Fetch the daily question from LeetCode
  - Send it to your email
- GitHub Actions (`.github/workflows/daily.yml`) to:
  - Schedule the script to run every day at 8:00 AM IST (2:30 AM UTC)
  - Run it without your intervention

---

## πŸ“¦ Requirements

- A [GitHub](https://github.com) account
- A Gmail account with [2FA enabled](https://myaccount.google.com/security)
- A [Gmail App Password](https://myaccount.google.com/apppasswords)

---

## πŸ”§ Setup Instructions

### 1. **Fork or Clone this Repository**
You can either fork this repo or clone it and push it to your own GitHub repo.

```bash
git clone https://github.com/yourusername/leetcode-daily-mailer.git
cd leetcode-daily-mailer

2. Add Your Secrets to GitHub

Go to your repo β†’ Settings β†’ Secrets and variables β†’ Actions β†’ New repository secret

Add the following:

Name Value
SENDER_EMAIL Your Gmail address (e.g. [email protected])
RECEIVER_EMAIL Where you want the daily question sent
EMAIL_PASSWORD Your App Password for Gmail

3. Check the Cron Schedule (optional)

In .github/workflows/daily.yml, the job is scheduled like this:

schedule:
  - cron: '30 2 * * *'  # This is 8:00 AM IST (2:30 AM UTC)

You can change the time by modifying the cron expression. Use crontab.guru for help.


4. Test it Manually (optional)

Go to the Actions tab of your repo β†’ Select "LeetCode Daily Mailer" β†’ Click "Run workflow" to test it now.


πŸ§ͺ Output Example

You'll receive an email like:

LeetCode Daily Question:

Title: Maximum Depth of Binary Tree
Difficulty: Easy
Tags: Depth-First Search, Tree

Link: https://leetcode.com/problems/maximum-depth-of-binary-tree/

0 commit comments

Comments
Β (0)