product-hunt-mailer

A Python CLI tool that fetches Product Hunt's daily top launches, generates AI-powered summaries using Gemini, and sends a beautifully formatted email digest via Resend.

000Python
ai-daily-newsai-toolsdaily-tasksemailernewsletterproducthunt

Last updated:

šŸš€ Product Hunt Daily Emailer

A Python CLI tool that fetches Product Hunt's daily top launches, generates AI-powered summaries using Gemini, and sends a beautifully formatted email digest via Resend.

Python License

image image

✨ Features

  • šŸ” Scrapes top products from Product Hunt homepage
  • šŸ¤– AI-powered summaries using Gemini 3 Flash Preview (free tier)
  • šŸ“§ Beautiful HTML email templates
  • āš™ļø YAML-based configuration
  • šŸ“ Raspberry Pi cron job ready

⚔ One-Line Install (Raspberry Pi / Linux)

curl -fsSL https://raw.githubusercontent.com/eyupucmaz/product-hunt-mailer/main/install.sh | bash

This interactive script will:

  • Install uv package manager
  • Clone the repository
  • Configure your API keys and email settings
  • Set up a cron job for scheduled emails

šŸ“‹ Prerequisites

šŸš€ Manual Setup

1. Clone the repository

git clone https://github.com/eyupucmaz/product-hunt-mailer.git
cd product-hunt-mailer

2. Install dependencies

# Install uv if you haven't
curl -LsSf https://astral.sh/uv/install.sh | sh

# Install project dependencies
uv sync

3. Configure environment variables

cp .env.example .env

Edit .env and add your API keys:

GEMINI_API_KEY=your_gemini_api_key_here
RESEND_API_KEY=your_resend_api_key_here

4. Configure email settings

cp config.example.yaml config.yaml

Edit config.yaml to set your recipients and sender email:

email:
  from: "Product Hunt Digest <digest@yourdomain.com>"
  subject_prefix: "šŸš€ Product Hunt Daily"

recipients:
  - name: "Your Name"
    email: "you@example.com"

Note: The sender email domain must be verified in your Resend dashboard.

5. Run

uv run python -m src.main

šŸ“ Raspberry Pi Deployment

Install uv on Raspberry Pi

curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.local/bin/env

Clone and Setup

cd ~
git clone https://github.com/eyupucmaz/product-hunt-mailer.git
cd product-hunt-mailer

uv sync

cp .env.example .env
cp config.example.yaml config.yaml
# Edit both files with your settings

Test

uv run python -m src.main

Setup Cron Job

crontab -e

Add one of these lines:

# Daily at 9:00 AM
0 9 * * * cd /home/pi/product-hunt-mailer && /home/pi/.local/bin/uv run python -m src.main >> /home/pi/product-hunt-mailer/cron.log 2>&1

# Daily at 8:00 AM and 6:00 PM
0 8,18 * * * cd /home/pi/product-hunt-mailer && /home/pi/.local/bin/uv run python -m src.main >> /home/pi/product-hunt-mailer/cron.log 2>&1

# Weekdays only at 9:00 AM
0 9 * * 1-5 cd /home/pi/product-hunt-mailer && /home/pi/.local/bin/uv run python -m src.main >> /home/pi/product-hunt-mailer/cron.log 2>&1

Note: Replace /home/pi with your actual home directory (echo $HOME)

šŸ“ Project Structure

product-hunt-mailer/
ā”œā”€ā”€ .env.example          # Environment variables template
ā”œā”€ā”€ config.example.yaml   # Configuration template
ā”œā”€ā”€ pyproject.toml        # Dependencies
ā”œā”€ā”€ README.md
└── src/
    ā”œā”€ā”€ __init__.py
    ā”œā”€ā”€ main.py           # CLI entry point
    ā”œā”€ā”€ scraper.py        # Product Hunt scraper
    ā”œā”€ā”€ summarizer.py     # Gemini AI integration
    └── mailer.py         # Resend email sender

āš™ļø Configuration Options

config.yaml

OptionDescription
email.fromSender email (must be verified in Resend)
email.subject_prefixEmail subject prefix
recipientsList of recipients with name and email
settings.product_countNumber of products to include (1-10)
gemini.modelGemini model to use

Gemini Models

ModelDescription
gemini-3-flash-previewLatest, fastest, recommended (free)
gemini-2.5-flashPrevious generation (free)

šŸ”§ Troubleshooting

IssueSolution
403 ForbiddenThe scraper uses browser impersonation to bypass bot detection. If issues persist, try updating curl_cffi.
GEMINI_API_KEY requiredMake sure .env file exists and contains your API key (uncommented)
Cron not runningUse absolute paths for uv in crontab. Check with which uv
No email receivedCheck Resend dashboard for delivery status. Verify sender domain.

šŸ“„ License

MIT License - feel free to use this for your own projects!

šŸ™ Credits