A Python crawler for Hacker News with AI-powered analysis and automated email delivery.
- Web Interface: Modern responsive UI for browsing news and analysis results
- AI Analysis: Powered by DeepSeek LLM for intelligent news summarization
- Email Reports: Beautiful HTML email reports with daily digest
- Parallel Processing: Multi-threaded analysis for faster performance
- GitHub Actions: Automated daily execution and email delivery
- Multiple Email Providers: Support for Gmail, QQ Mail, 163 Mail, etc.
pip install -r requirements.txtexport DEEPSEEK_API_KEY="your_api_key_here"python example_llm_usage.pycd web
python run_web.pyOpen browser at http://localhost:8080
- 🎨 Modern responsive UI design
- 📊 Real-time news and analysis display
- 🔄 One-click refresh
- 📱 Mobile-friendly
- ⚡ Live status updates
- 🎯 AI-powered insights
| Endpoint | Description |
|---|---|
GET / |
Homepage |
GET /api/news |
Get news data |
GET /api/analysis |
Get AI analysis results |
POST /api/refresh |
Refresh data |
GET /api/status |
Get processing status |
The project includes an independent LLM analyzer module:
- News Analysis: Automatic trend analysis and summarization
- Parallel Processing: Multi-threaded for faster performance
- Text Summarization: Intelligent content summarization
- Translation: Multi-language support
- Insights Generation: Deep analysis on specific topics
from llm_analyzer import LLMAnalyzer
from example_llm_usage import analyze_news_with_llm
# Parallel analysis (recommended)
analysis_results = analyze_news_with_llm(news_data, parallel=True, max_workers=3)
# Direct analyzer usage
analyzer = LLMAnalyzer()
analysis = analyzer.analyze_news(news_data)
summary = analyzer.summarize_text("Long text content")
translation = analyzer.translate_text("Hello World", "Chinese")Automate daily analysis and email delivery with GitHub Actions.
-
Push to GitHub
-
Configure Repository Secrets
Go to: Repository → Settings → Secrets and variables → Actions → New repository secret
Add the following secrets:
Secret Name Description DEEPSEEK_API_KEYDeepSeek API Key (Get here) EMAIL_SENDERSender email address (e.g., xxx@qq.com)EMAIL_PASSWORDEmail authorization code (not login password) EMAIL_RECIPIENTSRecipient emails, comma-separated -
Enable GitHub Actions
Go to: Repository → Actions → Click "I understand my workflows, go ahead and enable them"
-
Execution
- Automatic: Runs daily at 00:00 UTC (08:00 Beijing Time)
- Manual: Actions page → "Daily HN Analysis" → "Run workflow"
email_config.iniis in.gitignoreand won't be committed- Sensitive data is securely stored in GitHub Secrets
Create email_config.ini:
[qq]
smtp_server = smtp.qq.com
smtp_port = 587
sender_email = your_email@qq.com
sender_password = your_authorization_code
recipient_email = recipient1@example.com, recipient2@example.com
[app]
send_news_count = 20
max_workers = 3
max_comments = 30
topn = 100
model_name = deepseek-chat- Environment Variables (for CI/CD):
EMAIL_SENDER,EMAIL_PASSWORD,EMAIL_RECIPIENTS - Config File (for local dev):
email_config.ini
Each news item contains:
| Field | Description |
|---|---|
id |
News ID |
rank |
Ranking position |
title |
News title |
url |
Original link |
domain |
Source domain |
score |
Points |
comments |
Comment count |
- Login → Settings → Account
- Enable POP3/SMTP service
- Generate authorization code
- Enable 2-Step Verification
- Generate App Password
- Settings → POP3/SMTP → Enable
- Get authorization code
- Please respect the website's robots.txt rules
- Add appropriate delays to avoid server overload
- This project is for learning and research purposes only
MIT License