An open API service indexing awesome lists of open source software.

https://github.com/vivekbargude/leetcode-daily-mailer

๐Ÿ“ฌ Automatically get the LeetCode Daily Challenge delivered to your inbox every day at 8:00 AM IST using GitHub Actions and Python โ€” no servers or subscriptions required.
https://github.com/vivekbargude/leetcode-daily-mailer

automation cron-jobs email-bot-python github-actions leetcode leetcode-automation

Last synced: 4 months ago
JSON representation

๐Ÿ“ฌ Automatically get the LeetCode Daily Challenge delivered to your inbox every day at 8:00 AM IST using GitHub Actions and Python โ€” no servers or subscriptions required.

Awesome Lists containing this project

README

          

````markdown
# ๐Ÿ“ฌ 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. [you@gmail.com](mailto:you@gmail.com)) |
| `RECEIVER_EMAIL` | Where you want the daily question sent |
| `EMAIL_PASSWORD` | Your [App Password](https://myaccount.google.com/apppasswords) for Gmail |

---

### 3. **Check the Cron Schedule (optional)**

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

```yaml
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](https://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/
```

---