An advanced Python bot that automates LinkedIn company page posting with a focus on cybersecurity content, latest CVE updates, and AI-generated security insights.
- π Cybersecurity Focus: Generates professional posts about cybersecurity topics, threat intelligence, and security best practices
- π¨ Dual CVE Sources: Combines data from both NIST API and Reddit r/CVEWatch for comprehensive coverage
- π± Reddit Integration: Automatically fetches trending CVE discussions from r/CVEWatch community
- π’ Company Page Support: Posts to LinkedIn company pages (with fallback to personal feed)
- π€ AI Content Generation: Uses Google Gemini AI to create engaging, human-like content
- π§Ή Content Cleaning: Advanced cleaning to remove hidden characters and unwanted formatting from AI output
- π« Smart Deduplication: Never posts the same CVE or similar content twice
- π Daily Security Briefings: Automated posting at optimal business hours with daily digest format
- π Topic Management: Processes topics from file and tracks completed posts
- π Secure Login: Cookie-based authentication with verification code support
Your bot generates professional security briefings like:
Security Brief - January 15, 2025
This week's threat intelligence shows a 40% spike in enterprise ransomware targeting financial institutions. Security teams are reporting sophisticated attacks bypassing traditional email gateways, with CVE-2025-1234 (CVSS: 9.8) enabling remote code execution in widely-used VPN solutions.
The business impact is immediate - we're seeing average downtime of 72 hours and recovery costs exceeding $2M per incident. Security leaders should immediately audit VPN configurations and implement network segmentation as a critical control.
What defensive measures is your organization prioritizing this quarter?
#cybersecurity #ransomware #threatintelligence #infosec #dailybrief
git clone https://github.com/ovld-team/LinkedInDailyDigest.git
cd LinkedInDailyDigest
pip install -r requirements.txtCopy .env.example to .env and fill in your credentials:
cp .env.example .envRequired variables:
LINKEDIN_ACCESS_TOKEN: Your LinkedIn API access tokenGEMINI_API_KEY: Your Google Gemini API key
Optional variables:
LINKEDIN_ORG_URN: Organization URN for company page posting (e.g.,urn:li:organization:12345678)REDDIT_CLIENT_ID: Reddit API client ID (for r/CVEWatch integration)REDDIT_CLIENT_SECRET: Reddit API client secretREDDIT_USER_AGENT: Bot user agent string
- Go to LinkedIn Developer Portal
- Create a new app with "Share on LinkedIn" permissions
- Generate access token
- Get organization URN for company posting
- See detailed guide:
linkedin_api_setup.md
- Go to Google AI Studio
- Create a new API key
- Add it to your
.envfile
- Go to Reddit App Preferences
- Click "Create App" β Choose "script" type
- Fill in:
- Name: LinkedIn CVE Bot
- Redirect URI: http://localhost:8080
- Copy Client ID and Secret to your
.envfile
# Post once to personal feed or company page
python processor.py# Run daily scheduler (posts once per day at 9:00 AM)
python scheduler.py
# Test single scheduled post
python scheduler.py testSet your organization URN in the .env file:
LINKEDIN_ORG_URN=urn:li:organization:your_org_idLeave empty to post to personal profile.
# Test CVE fetching and see exactly what will be posted
python test_generation.py- API Authentication: Uses LinkedIn API with OAuth access tokens
- CVE Collection: Fetches vulnerabilities from both NIST API and Reddit r/CVEWatch
- Content Parsing: Extracts CVE details, CVSS scores, and descriptions from Reddit posts
- Deduplication: Checks against tracking database to avoid duplicate content
- Topic Selection: Chooses unused cybersecurity topics from
Topics.txt - Content Generation: Uses Gemini AI to create professional daily briefings
- Content Cleaning: Removes hidden characters, markdown, and unwanted formatting
- API Posting: Posts to company page or personal profile via LinkedIn API
- Tracking: Records posted CVEs, topics, and content hashes to prevent duplicates
The bot comes pre-loaded with 200+ current cybersecurity topics including:
- Critical zero-day exploits discovered this week
- Enterprise ransomware attacks surge across financial sector
- Advanced persistent threats targeting cloud infrastructure
- Multi-factor authentication bypass techniques emerge
- Supply chain security breaches impact major vendors
- And much more current, actionable content...
- NIST API: Official government vulnerability database
- Reddit r/CVEWatch: Community-driven CVE discussions and analysis
- Smart Parsing: Extracts CVE IDs, CVSS scores, and descriptions from Reddit posts
- Smart Merging: Combines both sources, prioritizing Reddit context when available
- CVSS Scoring: Includes severity ratings for risk assessment
- CVE Tracking: Never posts the same vulnerability twice
- Topic Rotation: Ensures variety in cybersecurity topics (30-day cooldown)
- Content Hashing: Prevents similar content from being posted
- Intelligent Fallbacks: Generates fresh content when duplicates detected
- Removes hidden Unicode characters
- Strips markdown formatting
- Preserves hashtags and links
- Normalizes whitespace
- Eliminates zero-width characters
- Daily security briefing format
- Human-like cybersecurity expert voice
- Business impact analysis
- Actionable security advice
- Community engagement prompts
- Relevant hashtags (#cybersecurity #infosec #dailybrief)
processor.py- Main cybersecurity content processor with LinkedIn API and Reddit integrationscheduler.py- Automated daily posting schedulertest_generation.py- Testing script for content generation and previewlinkedin_api_setup.md- LinkedIn API setup guideutils.py- Additional utilities (legacy)Topics.txt- Queue of cybersecurity topics to postTopics_done.txt- Completed topics log with timestampscve_tracking.json- CVE and content deduplication databaserequirements.txt- Python dependencies (simplified, no Selenium).env.example- Environment variables templatesetup_guide.md- Comprehensive setup instructions
- Store credentials securely in
.envfile - Use strong, unique passwords
- Enable 2FA on LinkedIn account
- Review generated content before posting
- Monitor for unusual account activity
- 9:00 AM: Morning threat briefing
- 1:00 PM: Midday community insights
- 5:00 PM: End-of-day security summary
- Maximum 3 posts per day
- Random delays (1-5 minutes) between actions
- Automatic daily counter reset
# Linux/macOS - run in background
nohup python scheduler.py > scheduler.log 2>&1 &
# Windows - run as service (requires additional setup)
# Or use Task Scheduler for automation- Access token expired: Generate new token every 60 days
- Insufficient permissions: Ensure app has "Share on LinkedIn" product
- Organization not found: Verify URN format and admin rights
- Rate limit exceeded: LinkedIn allows ~100 posts per day
- Gemini: Verify API key is valid and has quota
- Reddit: Check client ID/secret, ensure app is "script" type
- NIST: API is public, check internet connection
- Check
cve_tracking.jsonfor deduplication database - Verify topics in
Topics.txtaren't all used - Review
scheduler.logfor detailed error messages - Use
test_generation.pyto preview content and check API setup
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is for educational and legitimate business use only. Users are responsible for complying with LinkedIn's Terms of Service and applicable laws.
- Use responsibly and in accordance with LinkedIn's Terms of Service and API Terms
- LinkedIn API has built-in rate limiting (no browser automation required)
- CVE data is sourced from NIST's public API and Reddit community
- AI-generated content should be reviewed before posting
- Daily briefings are designed for cybersecurity thought leadership
- API approach is more reliable and compliant than browser automation