A "Digital Zamindar" automation system that generates and delivers professional PDF carousels for LinkedIn using GitHub Actions, GPT-4o-mini, and Python.
This project automates LinkedIn content creation by:
- 🤖 Using AI to generate fresh, trending content ideas on every run
- 📄 Creating professional multi-page PDF carousels (5-7 slides)
- 🎨 Supporting 5 modern color themes
- 📱 Delivering content to Telegram for easy manual posting
- ⏰ Running automatically every 10 minutes via GitHub Actions
The engine now generates professional LinkedIn carousels with:
- Multi-page PDFs: 7 slides per carousel (Cover + 5 Content + CTA)
- LinkedIn-optimized: 1080x1080px per slide (perfect for LinkedIn carousels)
- Real Text Content: PDFs contain actual selectable text (not just images)
- Professional Fonts: Uses Lato fonts with automatic fallback to system fonts
- 5 Color Themes: Professional, Bold, Minimalist, Gradient, Warm
- AI-Generated Ideas: Fresh trending content ideas on every run
- Carousel-Optimized Content: Structured hooks, slides, and CTAs
- Content Tracking: Carousel content saved to brain.json and history.json
- Backward Compatible: Single image generation still works
┌──────────────────┐
│ AI Idea Gen │ ← GPT-4 generates 3 trending ideas
│ (or brain.json) │
└────────┬─────────┘
│
▼
┌──────────────────┐
│ main.py │ ← Orchestrates the workflow
└────────┬─────────┘
│
├─→ GPT-4o-mini API (generates carousel content)
│
├─→ image_gen.py (creates 7-slide PDF carousel)
│
├─→ Telegram API (delivers PDF)
│
└─→ history.json (tracks posts)
- ✅ Zero-Cost Infrastructure: Runs entirely on GitHub's free tier
- ✅ AI-Generated Ideas: Fresh trending content ideas on every run
- ✅ Professional PDF Carousels: 7-slide PDFs with actual selectable text content
- ✅ Modern Typography: Uses Lato fonts (similar to Google Fonts) for professional appearance
- ✅ 5 Color Themes: Choose from Professional, Bold, Minimalist, Gradient, or Warm
- ✅ Smart Content Generation: GPT-4o-mini creates carousel-optimized content
- ✅ Content Tracking: Complete carousel content saved to brain.json for future reference
- ✅ Telegram Integration: One-tap posting maintains "organic" feel for LinkedIn
- ✅ Comprehensive Fallbacks: Graceful degradation if any feature fails
- ✅ Backward Compatible: Single image generation still works
git clone https://github.com/motyar/auto0.git
cd auto0Add these secrets to your GitHub repository:
- Go to: Settings → Secrets and variables → Actions → New repository secret
Required secrets:
OPENAI_API_KEY: Your OpenAI API key (Get it here)
Optional (but recommended) secrets:
TELEGRAM_BOT_TOKEN: Create a bot via @BotFatherTELEGRAM_CHAT_ID: Message your bot, then visithttps://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates
Optional (PDF carousel configuration):
THEME: Choose fromprofessional,bold,minimalist,gradient, orwarm(default:professional)USE_AI_IDEAS: Set totruefor AI-generated ideas orfalseto use brain.json (default:true)CAROUSEL_SLIDES: Number of content slides, 5-10 (default:7)
- Go to the Actions tab in your repository
- Click "I understand my workflows, go ahead and enable them"
You can manually trigger a test run:
- Go to Actions tab
- Click "Daily LinkedIn Post Generator"
- Click "Run workflow" → "Run workflow"
# Install dependencies
pip install -r requirements.txt
# Create .env file
cp .env.example .env
# Edit .env with your API keys
# Run the engine
python main.pyauto0/
├── .github/
│ └── workflows/
│ └── daily_post.yml # GitHub Actions workflow
├── brain.json # Content idea repository (fallback)
├── ideas_generated.json # AI-generated ideas (auto-created)
├── history.json # Posting history
├── main.py # Main orchestration script
├── image_gen.py # PDF carousel & image generation
├── requirements.txt # Python dependencies
├── fonts/ # Google Fonts cache (auto-created)
├── output/ # Generated PDFs and images
│ ├── linkedin_carousel_*.pdf # Generated PDF carousels
│ └── linkedin_post_*.png # Generated images (fallback)
└── README.md # This file
Set the THEME environment variable or GitHub secret to one of:
professional: Dark blue background with bright blue accents (default)bold: Black background with neon green/cyan accentsminimalist: Light gray/white background with coral/red accentsgradient: Purple-to-blue gradient backgroundwarm: Warm colors (coral, cream, orange tones)
By default, the engine uses AI to generate fresh ideas on every run. To use the static brain.json instead:
- Set
USE_AI_IDEAS=falsein your environment or GitHub secrets - Edit
brain.jsonto add your own content ideas
Set CAROUSEL_SLIDES environment variable to control the number of content slides (5-10):
- Default: 7 slides (Cover + 5 Content + CTA)
- Minimum: 5 slides (Cover + 3 Content + CTA)
- Maximum: 10 slides (Cover + 8 Content + CTA)
For custom colors beyond the 5 themes, edit the THEMES dictionary in image_gen.py:
THEMES = {
"my_custom_theme": {
"bg": "#1A1A1A", # Background color
"accent": "#FF6B6B", # Accent color
"text": "#FFFFFF", # Text color
"secondary": "#2C2C2C" # Secondary color
}
}Then set THEME=my_custom_theme in your environment.
Edit brain.json to add your own content ideas:
{
"id": 31,
"title": "Your Idea Title",
"description": "Your idea description",
"used": false
}Edit .github/workflows/daily_post.yml:
schedule:
- cron: '0 4 * * 1-5' # 9:30 AM IST, Mon-Fri- Scheduler Triggers: GitHub Actions runs at 9:30 AM IST (Mon-Fri)
- Idea Selection: Picks the first unused idea from
brain.json - Content Generation: GPT-4o-mini creates:
- Hook (attention-grabbing opening)
- Body (5-7 actionable SOP steps)
- CTA (call-to-action linking to Zenmic.com)
- Visual data (title + 3 key points)
- Image Creation: Pillow generates a branded 1200x675 image
- Telegram Delivery: Sends post text and image to your phone
- State Update: Marks idea as used, logs to history.json
- Auto-Commit: Pushes changes back to repository
LinkedIn's algorithm heavily penalizes obvious automation. By sending content to Telegram first:
- ✅ You review quality before posting
- ✅ Manual posting appears "organic" to LinkedIn
- ✅ One-tap sharing from mobile
- ✅ Maintains human touch and engagement
This is the "Pure Organic" strategy that avoids shadowbans.
- Never commit
.envfile (it's in.gitignore) - Store all API keys as GitHub Secrets
- The OpenAI API key only needs Chat Completions permission
- Telegram bot can only send messages (read-only chat access)
Check the Actions tab to:
- View run history
- Download generated images (stored as artifacts for 30 days)
- Debug any failures
- Monitor API costs
- GitHub Actions: Free (2,000 minutes/month)
- GPT-4o-mini:
$0.0001 per post ($0.002/month for 20 posts) - Total: Essentially FREE ✨
This is an internal automation tool, but feel free to:
- Fork the repository
- Customize for your needs
- Share improvements via PR
MIT License - Use it however you want!
pip install -r requirements.txt- Add the secret to GitHub repository settings
- For local testing, create a
.envfile
- Fixed in latest version: PDFs now use ReportLab's native text rendering
- Text is fully selectable and searchable in generated PDFs
- Font system automatically uses Lato (clean, modern) with fallback to DejaVu/system fonts
- PDF file sizes are much smaller (50-60KB vs 200KB+ for image-based PDFs)
- Fixed in latest version: Now uses Lato fonts (similar to Google Fonts like Poppins/Inter)
- Automatic fallback to system fonts if Lato is unavailable
- No internet connection required for fonts to work
- Fixed in latest version: Complete carousel content now saved to:
brain.json: Stores generated carousel for each idea undergenerated_carouselfieldhistory.json: Tracks all posted content with full carousel data
- This allows you to review and reuse successful content patterns
- The system auto-creates
template.pngon first run - Check that Pillow installed correctly
- Verify font availability (uses Lato or DejaVu Sans)
- Check that GitHub Actions are enabled
- Verify cron schedule in UTC (not IST)
- Check workflow permissions in Settings → Actions
Built with ❤️ for Zenmic.com | Content That Converts
