Automatically crawl three tech blogs and generate professional LinkedIn posts using AI.
✨ Three Fixed Blog Sources - Crawls Fullstack Labs, React Native, and AWS DevOps blogs
🤖 AI-Powered Posts - Generate engaging LinkedIn posts using OpenAI GPT-3.5
📡 RSS Feed Support - Stable extraction using RSS feeds where available
🔒 Secure - API keys stored in .env file (not committed to git)
The tool automatically crawls these three blogs:
- Fullstack Labs - https://www.fullstack.com/labs/resources/blog
- React Native - https://reactnative.dev/blog (via RSS feed)
- AWS DevOps - https://aws.amazon.com/blogs/devops/
# Clone the repository
git clone https://github.com/yourusername/linkedin-post-generator.git
cd linkedin-post-generator
# Create virtual environment (optional but recommended)
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt# Copy environment template
cp .env.example .env
# Edit .env and add your OpenAI API key
nano .env # or use your preferred editorAdd your API key to .env:
OPENAI_API_KEY=sk-proj-your-actual-api-key-herepython3 main.pyThat's it! The tool will crawl all three blogs and generate LinkedIn posts automatically.
linkedin-post-generator/
├── crawlers/
│ ├── __init__.py
│ ├── fullstack_crawler.py # Fullstack Labs crawler
│ ├── expo_crawler.py # React Native RSS crawler
│ └── aws_crawler.py # AWS DevOps crawler
├── main.py # Main application entry point
├── config.py # Configuration management
├── post_generator.py # AI post generator
├── output/ # Generated posts (created automatically)
│ ├── linkedin_posts.csv
│ └── linkedin_posts.json
├── .env # Environment variables (not in git)
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
└── README.md # This file
Edit .env file:
# Required
OPENAI_API_KEY=sk-your-key-here
# Optional
MAX_ARTICLES_PER_URL=30 # Articles per blog (default: 30)
EXTRACT_CONTENT=false # Extract full content (slower, default: false)
OUTPUT_FILE=output/linkedin_posts.csv # Output filename- OPENAI_API_KEY (required): Your OpenAI API key
- MAX_ARTICLES_PER_URL (optional): Maximum articles to process per blog (default: 30)
- EXTRACT_CONTENT (optional): Set to
trueto extract full article content for better posts (slower) - OUTPUT_FILE (optional): Path and filename for output CSV (default:
output/linkedin_posts.csv)
The tool generates two files in the output/ directory:
- linkedin_posts.csv - Spreadsheet format with all posts
- linkedin_posts.json - JSON format for programmatic use
Each post includes:
- Source (Fullstack, Expo, or AWS DevOps)
- Article URL
- Article title
- Generated LinkedIn post
- Timestamp
======================================================================
✅ COMPLETED! Generated 45 LinkedIn posts
======================================================================
Breakdown by source:
• Fullstack: 12 posts
• Expo: 20 posts
• AWS DevOps: 13 posts
Files created:
📄 output/linkedin_posts.csv
📄 output/linkedin_posts.json
Using OpenAI GPT-3.5-turbo:
- ~$0.001-0.002 per post
- 30 posts ≈ $0.03-0.06
- 100 posts ≈ $0.10-0.20
Very affordable! 💰
- Python 3.10+
- OpenAI API key (Get one here)
- Internet connection
All dependencies are listed in requirements.txt:
openai>=1.0.0- OpenAI API clientrequests>=2.31.0- HTTP requestsbeautifulsoup4>=4.12.0- HTML parsinglxml>=4.9.0- XML/HTML parser
-
Crawl Blogs - Each crawler extracts articles from its specific blog
- Fullstack: Parses HTML structure
- React Native: Uses RSS feed (most reliable)
- AWS DevOps: Parses HTML structure
-
Generate Posts - For each article:
- Sends article title (and content if enabled) to OpenAI
- GPT-3.5 generates a professional LinkedIn post
- Post includes hook, key takeaways, and hashtags
-
Save Results - Exports all posts to CSV and JSON formats
No articles found from a blog?
- Check your internet connection
- The blog's HTML structure may have changed
- Check the crawler file for that specific blog
API errors?
- Verify your OpenAI API key in
.env - Check you have credits in your OpenAI account
- Ensure
.envfile is in the project root directory
Import errors?
pip install -r requirements.txtPermission denied error?
- Make sure
OUTPUT_FILEin.envuses a relative path likeoutput/linkedin_posts.csv - Don't use absolute paths like
/output/linkedin_posts.csv
Rate limiting?
- The script includes 1-second delays between API calls
- If you hit rate limits, reduce
MAX_ARTICLES_PER_URLin.env
- Create a new crawler in
crawlers/(e.g.,your_blog_crawler.py) - Implement the
crawl()andextract_content()methods - Add the import to
crawlers/__init__.py - Update
main.pyto use the new crawler
Edit post_generator.py to customize the AI prompt for different post styles.
Pull requests welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
MIT License - feel free to use for personal or commercial projects!
Having issues? Open an issue , Inspired by linkedin-post-automator