A Bluesky and X/Twitter bot that automatically posts fictional Larry David quotes every 3 hours and 34 minutes, as if he were commenting on modern life in 2025 with his signature neurotic and comedic perspective.
- Cross-platform posting: Posts to both Bluesky and Twitter (X)
- Automatic scheduling: Posts every 3 hours and 34 minutes using a scheduler
- AI-generated quotes: Uses Google's Gemini to create unique, in-character Larry David quotes
- Duplicate prevention: Caches recent posts to avoid repeats
- Modern context: Quotes reference current technology (AirPods, TikTok, AI, Zoom, etc.)
- Easy deployment: Ready to deploy,
- Fallback system: Includes backup quotes if AI generation fails
- "You know what I hate? When you're at a restaurant and the server says 'Enjoy your meal' and you say 'You too'."
- "I don't trust anyone who's nice to me but rude to the waiter. Because they're just waiting until they can be rude to me too."
- "I don't like to make plans for the day because then the word 'premeditated' gets thrown around in the courtroom."
- "You know what's interesting about politics? It's not interesting."
- Bluesky Account: You need a Bluesky account and an App Password
- Google Cloud API Key: For generating quotes with Gemini
- Twitter API Access (Optional): For cross-posting to Twitter (X) using API v2
-
Clone the repository:
git clone <your-repo-url> cd Larry-David-Bot
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp env.example .env
Edit
.envwith your credentials:# Required BLUESKY_HANDLE=your-handle.bsky.social BLUESKY_APP_PASSWORD=your-app-password GEMINI_API_KEY=your-gemini-api-key # Twitter API v2 (Optional) TWITTER_BEARER_TOKEN=your-bearer-token TWITTER_API_KEY=your-api-key TWITTER_API_SECRET=your-api-secret TWITTER_ACCESS_TOKEN=your-access-token TWITTER_ACCESS_SECRET=your-access-secret -
Run the bot:
python larry_david_bot.py
- Go to Bluesky Settings
- Navigate to "App Passwords"
- Create a new app password
- Use this password in your
.envfile
- Go to the Twitter Developer Portal
- Create a new Project and App
- Under "User authentication settings":
- Enable OAuth 2.0
- Set App permissions to "Read and Write"
- Set Type of App to "Web App, Automated App or Bot"
- Set Callback URI to
https://localhost - Set Website URL to
https://github.com/Cauchon/Larry-David-Bot
- Go to "Keys and tokens" and generate:
- API Key and Secret
- Access Token and Secret
- Bearer Token (under "Authentication Tokens")
-
Run the test script to verify your configuration:
python test_bot.py
-
The bot will test:
- Environment variables
- Gemini API connection
- Fallback quotes
- Twitter API configuration (if provided)
-
Connect your repository to Render.com
-
Create a new Worker Service
-
Configure the service:
- Build Command:
pip install -r requirements.txt - Start Command:
python larry_david_bot.py - Environment: Python
- Build Command:
-
Add environment variables in Render dashboard:
BLUESKY_HANDLEBLUESKY_APP_PASSWORDGEMINI_API_KEYTWITTER_BEARER_TOKEN(if using Twitter API v2)TWITTER_API_KEY(if using Twitter API v2)TWITTER_API_SECRET(if using Twitter API v2)TWITTER_ACCESS_TOKEN(if using Twitter API v2)TWITTER_ACCESS_SECRET(if using Twitter API v2)
-
Deploy! The bot will start posting every 3 hours and 34 minutes.
The bot posts every 3 hours and 34 minutes by default. To change this, modify the schedule in larry_david_bot.py:
schedule.every(214).minutes.do(self.post_quote)- Character limit: 280 characters (Twitter-compatible)
- AI model: gemini-flash-latest
- Temperature: Default (creative)
- Fallback quotes: 5 pre-written quotes if AI fails
- Cache size: Last 100 posts
- Storage: JSON file (
recent_posts.json) - Retry attempts: Up to 10 attempts for unique quotes
Larry-David-Bot/
├── larry_david_bot.py # Main bot script
├── test_bot.py # Test script for verification
├── requirements.txt # Python dependencies
├── render.yaml # Render.com deployment config
├── env.example # Environment variables template
├── README.md # This file
└── recent_posts.json # Generated cache file
The bot logs all activities to:
- Console output: Real-time logs
- File:
larry_david_bot.log
Edit the get_fallback_quote() method in larry_david_bot.py:
fallback_quotes = [
"Your new quote here, Jeff!",
# ... existing quotes
]Edit the generate_larry_quote() method to change the quote style or topics.
Modify the scheduler in run_scheduler() method.
- Authentication errors: Check your Bluesky handle and app password
- API rate limits: The bot includes retry logic for Gemini API
- Duplicate posts: Check the
recent_posts.jsoncache file - Deployment issues: Ensure all environment variables are set in Render
Check the logs for detailed error information:
tail -f larry_david_bot.logFeel free to submit issues or pull requests to improve the bot!
This project is open source. Feel free to use and modify as needed.
"You know what I like about this bot? It's like having me in your pocket, but without the social anxiety." - Larry David