Skip to content

lmanchu/twitter-curator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Twitter Curator

πŸ€– AI-powered Twitter automation system with persona-driven content generation and intelligent engagement.

Features

  • βœ… Automated Tweet Posting - Schedule and post original tweets automatically
  • βœ… URL Tracking - Capture and record tweet URLs for analytics
  • βœ… Persona-Driven Content - Generate authentic content based on your personal profile
  • βœ… Smart Engagement - Auto-reply to relevant tweets in your niche
  • βœ… Anti-Detection - Uses Puppeteer with stealth plugin to avoid platform detection
  • βœ… macOS Integration - LaunchAgents for scheduled automation

Tech Stack

  • Node.js - Runtime environment
  • Puppeteer v24.27.0 - Browser automation (M2 Mac compatible)
  • Puppeteer Extra + Stealth Plugin - Anti-detection
  • Google Gemini API - AI content generation
  • macOS LaunchAgents - Scheduling system

Prerequisites

  • Node.js 16+
  • macOS (for LaunchAgents)
  • Google Gemini API key
  • Twitter account (logged in via Chrome profile)

Installation

# Clone the repository
git clone https://github.com/lmanchu/twitter-curator.git
cd twitter-curator

# Install dependencies
npm install

# Copy environment template
cp .env.example .env

# Edit .env and add your API keys
nano .env

Configuration

1. Environment Variables

Create a .env file:

GEMINI_API_KEY=your_gemini_api_key_here
HEADLESS=true
DRY_RUN=false

2. Persona Profile

Update PERSONA_FILE path in config.js to point to your persona profile markdown file.

3. Chrome Login

Run once with HEADLESS=false to login to Twitter:

HEADLESS=false node twitter-curator.js

Login manually when browser opens. Session will be saved to chrome-user-data/.

Usage

Manual Run

# Dry run (test without posting)
DRY_RUN=true node twitter-curator.js

# Live posting
node twitter-curator.js

Project Structure

twitter-curator/
β”œβ”€β”€ twitter-curator.js        # Main automation script
β”œβ”€β”€ content-generator.js      # AI content generation
β”œβ”€β”€ config.js                 # Configuration
β”œβ”€β”€ package.json              # Dependencies
β”œβ”€β”€ .env                      # Environment variables (not committed)
β”œβ”€β”€ chrome-user-data/         # Saved browser session (not committed)
β”œβ”€β”€ logs/                     # Execution logs
└── posted-tweets.json        # Tweet history with URLs

How It Works

  1. Content Generation: Uses Gemini AI to generate original tweets based on your persona
  2. Browser Automation: Puppeteer navigates to Twitter and posts tweets
  3. URL Capture: After posting, retrieves the tweet URL from your profile
  4. Engagement: Searches for relevant tweets and generates contextual replies
  5. Logging: Records all activities with timestamps and URLs

Key Technical Details

Button Selector

Uses [data-testid="tweetButtonInline"] for main tweet composition (not the modal tweetButton).

M2 Mac Compatibility

Puppeteer v24.27.0 resolves Rosetta compatibility issues on Apple Silicon.

Anti-Detection

  • Stealth plugin to hide automation markers
  • Random delays to mimic human behavior
  • Persistent Chrome profile (no repeated logins)
  • Custom user agent

Troubleshooting

"Post button not found"

  • Check if Twitter UI has changed
  • Try updating the selector in twitter-curator.js

Rosetta errors on M2 Mac

  • Ensure Puppeteer is v24+: npm install puppeteer@^24.27.0

Login required every time

  • Check chrome-user-data/ directory exists
  • Run once with HEADLESS=false to login

Version History

See CHANGELOG.md for detailed version history.

License

MIT

Disclaimer

⚠️ Use responsibly: Automated posting may violate Twitter's Terms of Service. This tool is for educational purposes. Use at your own risk.

Author

Built with ❀️ by Lman


πŸ€– Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

About

πŸ€– AI-powered Twitter automation with persona-driven content generation

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •