Skip to content

m6un/rss-worker

Repository files navigation

RSS Digest Worker

Cloudflare Workers Cloudflare AI SendGrid MIT License

A serverless RSS/Atom feed digest service that fetches your favorite blogs, summarizes them using AI, and sends beautiful email digests. Built with Cloudflare's edge technologies.

📺 Demo

Watch the demo

✨ Features

  • 📨 Automated Email Digests: Get updates from your favorite blogs in one beautiful email
  • 🤖 AI-Powered Summaries: Each article is automatically summarized using Cloudflare's Workers AI
  • 🎨 Modern Design: Clean, responsive email template that works across all email clients
  • Flexible Scheduling: Configure your preferred delivery days and times
  • 🔒 Secure & Scalable: Built on Cloudflare's global network
  • 💨 Fast & Efficient: Parallel processing of feeds with batch support

🚀 Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • Wrangler CLI
  • Cloudflare account (free tier works!)
  • SendGrid account (free tier works again!)

Manual Setup

  1. Clone and install dependencies:
git clone https://github.com/m6un/rss-worker.git
cd rss-worker
npm install
  1. Configure environment:
# Copy example env file
cp .env.example .dev.vars

# Add your SendGrid API key
echo "SENDGRID_API_KEY=your_key_here" >> .dev.vars
  1. Set up database:
# Create D1 database
wrangler d1 create prod-rss-worker

# Apply schema
wrangler d1 execute prod-rss-worker --file=./schema.sql
  1. Add your feeds:
INSERT INTO feeds (url, user_id, blog_name) VALUES 
('https://blog.example.com/feed.xml', 1, 'Example Blog');

INSERT INTO user_preferences (
    user_id, 
    cron_schedule, 
    email_to, 
    email_from, 
    email_subject
) VALUES (
    1,
    '0 9 * * *',  -- Daily at 9 AM
    'your.email@example.com',
    'digest@yourdomain.com',
    'Your Daily Tech Digest'
);
  1. Deploy:
npm run deploy

💻 Development

Local Development

# Start local development server
npm run dev

🏗️ Architecture

The service is built using modern serverless technologies:

How It Works

  1. Feed Processing:

    • Fetches RSS/Atom feeds in parallel batches
    • Filters out previously processed items
    • Generates AI summaries for new content
  2. Email Generation:

    • Creates beautiful HTML emails
    • Mobile-responsive design
    • Sanitized content for security
  3. Delivery:

    • Scheduled via cron triggers
    • Configurable delivery times
    • Error handling and retries

Development Process

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📧 Support

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages