"Ten memes a day keeps the doctor away." Dr. Runtime Exception, Chief of Memedicine
A beautifully crafted Go application that delivers the top 10 memes from r/programmerhumor straight to your inbox every day.
- 🎭 Fetches the top 10 memes from r/programmerhumor
- 📧 Delivers them in a beautifully formatted HTML email
- 🚀 Fast and efficient Go implementation
- 🔒 Uses environment variables for configuration
- Go 1.24 or higher
- Resend account for email delivery
- Internet connection to fetch memes from Reddit
-
Clone this repository:
git clone https://github.com/alexisbouchez/dailydoseofmemes.git cd dailydoseofmemes
-
Set up environment variables:
export RESEND_API_KEY=your_resend_api_key export RECIPIENT_EMAIL=your_email@example.com export SENDER_EMAIL=memes@yourdomain.com
-
Build the application:
go build -o meme-mailer
-
Run it:
./meme-mailer
Add a line to your crontab to run the application daily:
# Edit your crontab
crontab -e
# Add this line to run it every day at 9 AM
0 9 * * * cd /path/to/dailydoseofmemes && RESEND_API_KEY=your_key RECIPIENT_EMAIL=your@email.com SENDER_EMAIL=memes@yourdomain.com ./meme-mailer
-
Create a batch file (run_memes.bat) with:
@echo off cd C:\path\to\dailydoseofmemes set RESEND_API_KEY=your_key set RECIPIENT_EMAIL=your@email.com set SENDER_EMAIL=memes@yourdomain.com meme-mailer.exe
-
Set up a task in Windows Task Scheduler to run this batch file daily.
The application consists of three main components:
- Scraper (
scraper/reddit.go
): Handles fetching memes from Reddit - Mailer (
mailer/resend.go
): Manages email formatting and sending via Resend - Main (
main.go
): Coordinates the overall process
MIT
- Resend for their amazing email API
- Reddit and the r/programmerhumor community for the endless memes