- Add RSS news crawler with 5 international medical tech news sources - Configure GitHub Actions for automated bi-daily news updates - Implement smart data loading with fallback mechanism - Clean up mock data (reduced from 55+ items to 1 fallback item) - Add comprehensive documentation and troubleshooting guide - Create verification and testing scripts Key Features: - Real-time news from MedTech Dive, Medical Device Network, etc. - Automated crawling via GitHub Actions (8:00 & 20:00 Beijing time) - Graceful degradation when crawler data unavailable - Date parsing fixes and User-Agent configuration - 20 real news articles successfully crawled Documentation: - NEWS_CRAWLER_USAGE.md - User guide - NEWS_CRAWLER_IMPROVEMENTS.md - Implementation details - REAL_NEWS_CRAWLER_DESIGN.md - Architecture design - TROUBLESHOOTING.md - Debug guide - test-news-data.html - Browser testing tool 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
name: Crawl Healthcare News
|
|
|
|
on:
|
|
schedule:
|
|
# 每天早上8点和晚上8点执行(北京时间)
|
|
- cron: '0 0,12 * * *'
|
|
workflow_dispatch: # 允许手动触发
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'scripts/crawl-news.js'
|
|
- '.github/workflows/crawl-news.yml'
|
|
|
|
jobs:
|
|
crawl:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '20'
|
|
|
|
- name: Install crawler dependencies
|
|
run: |
|
|
cd scripts
|
|
npm install
|
|
|
|
- name: Crawl news
|
|
run: |
|
|
cd scripts
|
|
npm run crawl
|
|
|
|
- name: Commit and push if changed
|
|
run: |
|
|
git config --local user.email "[email protected]"
|
|
git config --local user.name "GitHub Action"
|
|
git add public/data/news.json
|
|
git diff --quiet && git diff --staged --quiet || (git commit -m "🤖 Auto-update news data [skip ci]" && git push)
|