This bot runs every morning at 10:00 AM, scrapes the latest AI news, writes a full Substack post using Claude, and saves a draft to dronagangarapu.substack.com automatically.
Open Terminal and run:
pip3 install anthropic requests python-dotenv markdowncd ~/SubstackBot
cp .env.template .env
open .env # edit with any text editorFill in the three values:
- Go to console.anthropic.com
- Create an API key and paste it as
ANTHROPIC_API_KEY
This lets the bot post on your behalf without needing a password.
- Open Chrome and go to dronagangarapu.substack.com
- Make sure you're logged in
- Press
Cmd + Option + Ito open DevTools - Go to Application → Cookies → https://dronagangarapu.substack.com
- Find the cookie named
connect.sid - Copy its full value (starts with
s%3A...) - In
.env, set:SUBSTACK_COOKIE=connect.sid=s%3A...
⚠️ This cookie expires periodically. If the bot stops posting, repeat this step.
- Sign up free at pexels.com/api
- Paste your key as
PEXELS_API_KEY
python3 ~/SubstackBot/daily_ai_post.pyCheck your Substack dashboard for a new draft. Posts are saved as drafts — you review and publish them yourself.
Local backups of every post are saved in ~/SubstackBot/posts/.
cp ~/SubstackBot/com.drona.daily-ai-post.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.drona.daily-ai-post.plistTo verify it's scheduled:
launchctl list | grep dronaTo check logs after it runs:
cat /tmp/daily_ai_post.log
cat /tmp/daily_ai_post_err.loglaunchctl unload ~/Library/LaunchAgents/com.drona.daily-ai-post.plist
rm ~/Library/LaunchAgents/com.drona.daily-ai-post.plist- 🔍 Searches the web for AI, LLM, AI agents, and GenAI news from the last 24 hours
- ✍️ Uses Claude to write a polished newsletter with a title, subtitle, and full body
- 🖼️ Fetches a relevant cover image from Pexels
- 📬 Creates a draft on your Substack (you review before publishing)
- 💾 Saves a local Markdown backup in
~/SubstackBot/posts/