Files
website/verify-news.sh
BrunoGaoandClaude 4da23af857 feat: Implement real RSS news crawler system with automated updates
- 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]>
2025-10-14 07:56:02 +08:00

49 lines
1.4 KiB
Bash
Executable File

#!/bin/bash
# 验证新闻爬虫数据
echo "🔍 验证新闻爬虫系统..."
echo ""
# 1. 检查数据文件
if [ -f "public/data/news.json" ]; then
echo "✅ 数据文件存在: public/data/news.json"
# 2. 统计新闻数量
NEWS_COUNT=$(cat public/data/news.json | jq 'length')
echo "📊 总新闻数: $NEWS_COUNT 条"
# 3. 按来源统计
echo ""
echo "📰 新闻来源分布:"
cat public/data/news.json | jq -r 'group_by(.source) | .[] | " \(.[0].source): \(length)条"'
# 4. 按分类统计
echo ""
echo "📂 分类分布:"
cat public/data/news.json | jq -r 'group_by(.category) | .[] | " \(.[0].category): \(length)条"'
# 5. 最新3条新闻
echo ""
echo "🆕 最新3条新闻:"
cat public/data/news.json | jq -r '.[:3] | .[] | " 📌 \(.title | .[0:60])... (\(.source))"'
# 6. 热门新闻
echo ""
HOT_COUNT=$(cat public/data/news.json | jq '[.[] | select(.isHot == true)] | length')
echo "🔥 热门新闻: $HOT_COUNT 条"
# 7. 最新抓取时间
echo ""
LATEST_CRAWL=$(cat public/data/news.json | jq -r '.[0].crawledAt')
echo "⏰ 最新抓取时间: $LATEST_CRAWL"
echo ""
echo "✅ 新闻数据验证完成!"
echo "🌐 访问 http://192.168.1.83:5175/website/industry-news 查看效果"
else
echo "❌ 数据文件不存在"
echo "💡 请先运行: cd scripts && npm run crawl"
exit 1
fi