How joyce677/trendradar works
Project type and purpose
• TrendRadar is an open-source “hot-trend” aggregator and notifier tool.
• It periodically pulls trending topics from multiple platforms (via the newsnow API), filters them by user-defined keywords, generates multi-format outputs (HTML, JSON, TXT), and pushes notifications to chat/notification services.
File structure
• .github/workflows/crawler.yml → GitHub Actions schedule
• main.py → core crawler + filter + output + notification logic
• config/config.yaml & config/frequency_words.txt → behavior and keyword configuration
• output/YYYYMMDD/... → timestamped archives of HTML and TXT snapshots
• api/trends.json → machine-readable JSON feed
• index.html & img/ → static-site entrypoint, assets
• docker/ → Dockerfile, docker-compose.yml, entrypoint.sh, manage.py for containerized deployment
README for additional insights
• Three report modes: daily/current/incremental
• Multi-channel webhook support: Enterprise WeChat, Feishu, DingTalk, Telegram
• GitHub Pages hosting of static output
• Docker & GitHub Actions for zero-tech, 30-second deployments
a. Main components:
– Scheduler: GitHub Actions (crawler.yml) or Docker cron (entrypoint.sh)
– TrendRadar Service: Python main.py + config files
– External Data Sources: newsnow API endpoints for each platform
– Storage: Git repo “output/” folder (HTML/TXT), api/trends.json
– Notification Endpoints: Webhook receivers (WeChat, Feishu, DingTalk, Telegram)
– Hosting: GitHub Pages serving static index.html + output
b. Relationships & interactions:
• Scheduler → invokes TrendRadar Service
• Service → HTTP GET → newsnow API (multiple source IDs)
• Service → processes & filters → writes to output folder & api/trends.json
• Service → HTTP POST → each configured webhook URL
• GitHub repo → GitHub Pages → end users view static site
c. Architectural patterns/design principles:
• ETL pipeline (Extract from newsnow, Transform via keyword rules, Load into static files)
• Configuration-driven (all behavior in YAML & TXT)
• Infrastructure-as-code (GitHub Actions + Docker Compose)
d. Key technologies/frameworks/libraries:
• Python 3.x (main.py)
• newsnow API
• YAML/TXT for config
• GitHub Actions (workflow)
• Docker (container & compose)
• Webhook integrations (HTTP POST)
• GitHub Pages (static hosting)
Be detailed but not cluttered
– Highlight extensibility: annotate config files as “extension points.”