AI-powered automated content curator that transforms breaking tech news into engaging Facebook posts.
Fetch → Curate → Generate → Post — all on autopilot, every 6 hours.
- 🔍 Smart News Curation — Aggregates from TechCrunch, The Verge, Ars Technica, Wired, and Hacker News
- 🧠 AI-Powered Selection — Gemini 2.5 Flash analyzes and picks the most impactful story
- ✍️ Educational Captions — Generates engaging, informative captions that teach readers something new
- 🎨 AI Image Generation — Creates stunning branded visuals using FLUX.2
- 📱 Auto Facebook Posting — Posts with image, caption, and article link in comments
- 🔄 Duplicate Prevention — Remembers what's been posted to keep content fresh
- ⏰ Serverless Scheduling — Runs automatically via GitHub Actions (zero hosting costs!)
| Layer | Technology |
|---|---|
| AI/LLM | Google Gemini 2.5 Flash Lite |
| Image Gen | FLUX.2 Klein 4B via deAPI |
| Storage | Cloudinary (images) + Supabase (PostgreSQL) |
| Social | Facebook Graph API |
| Automation | GitHub Actions (cron) |
| Language | Python 3.10+ |
- Python 3.10+
- API keys for: Gemini, deAPI, Facebook, Supabase, Cloudinary
git clone https://github.com/Fatin-Ishraq/next-prompt.git
cd next-prompt
pip install -r requirements.txtCreate a .env file in the root directory:
# AI Services
GEMINI_API_KEY=your_gemini_api_key
DE_API_Image_KEY=your_deapi_key
# Facebook
FB_PAGE_ID=your_page_id
FB_APP_ID=your_app_id
FB_APP_SECRET=your_app_secret
fb_user_access_token=your_page_access_token
# Database (Supabase)
supabase_url=https://your-project.supabase.co
supabase_key=your_supabase_anon_key
# Image Storage (Cloudinary)
cloudinary_cloud_name=your_cloud_name
cloudinary_api_key=your_api_key
cloudinary_api_secret=your_api_secretRun this SQL in your Supabase SQL Editor:
-- Posts table
CREATE TABLE posts (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
url TEXT NOT NULL UNIQUE,
title TEXT NOT NULL,
caption TEXT,
image_url TEXT,
fb_post_id TEXT,
genre TEXT DEFAULT 'tech',
posted_at TIMESTAMPTZ DEFAULT NOW()
);
-- Context table (for token storage)
CREATE TABLE context (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
key TEXT NOT NULL UNIQUE,
value TEXT,
updated_at TIMESTAMPTZ DEFAULT NOW()
);# Exchange short-lived token for permanent page token
python modules/token_manager.py --setup YOUR_SHORT_LIVED_TOKEN💡 Get your short-lived token from Facebook Graph Explorer
# Dry run (simulates everything without posting)
python main.py --dry-run --single
# Post for real
python main.py --singleThe included workflow runs automatically every 6 hours.
- Push your code to GitHub
- Go to Settings → Secrets and variables → Actions
- Add these repository secrets:
| Secret Name | Description |
|---|---|
GEMINI_API_KEY |
Google Gemini API key |
DE_API_IMAGE_KEY |
deAPI image generation key |
FB_PAGE_ID |
Your Facebook Page ID |
FB_APP_ID |
Facebook App ID |
FB_APP_SECRET |
Facebook App Secret |
FB_USER_ACCESS_TOKEN |
Page access token |
SUPABASE_URL |
Supabase project URL |
SUPABASE_KEY |
Supabase anon key |
CLOUDINARY_CLOUD_NAME |
Cloudinary cloud name |
CLOUDINARY_API_KEY |
Cloudinary API key |
CLOUDINARY_API_SECRET |
Cloudinary API secret |
- The workflow triggers at 00:00, 06:00, 12:00, 18:00 UTC or manually via Actions tab
next-prompt/
├── main.py # Main orchestrator
├── config.py # Configuration & settings
├── requirements.txt # Dependencies
├── modules/
│ ├── rss_fetcher.py # RSS feed aggregation
│ ├── ai_engine.py # Gemini AI integration
│ ├── image_generator.py # FLUX.2 image generation
│ ├── cloudinary_uploader.py # Image hosting
│ ├── facebook_poster.py # Facebook Graph API
│ ├── database.py # Supabase operations
│ └── token_manager.py # Facebook token handling
└── .github/
└── workflows/
└── autopost.yml # Scheduled automation
┌──────────────┐ ┌───────────────┐ ┌────────────────┐
│ RSS Feeds │────▶│ AI Curation │────▶│ Caption Writer │
│ (5 sources) │ │ (Gemini) │ │ (Gemini) │
└──────────────┘ └───────────────┘ └───────┬────────┘
│
┌──────────────┐ ┌───────────────┐ ┌───────▼────────┐
│ Facebook │◀────│ Cloudinary │◀────│ Image Gen │
│ Post! │ │ Upload │ │ (FLUX.2) │
└──────────────┘ └───────────────┘ └────────────────┘
Every cycle:
- Fetch — Pulls latest articles from 5 major tech sources
- Filter — Removes already-posted articles
- Select — AI picks the most engaging/impactful story
- Write — AI generates an educational caption
- Visualize — AI creates a branded image prompt → FLUX.2 generates the image
- Upload — Image hosted on Cloudinary for reliability
- Post — Published to Facebook with link in comments
- Remember — Saved to database to prevent duplicates
MIT License — feel free to use, modify, and build upon this project!
Made with ☕ and curiosity