# trending **Repository Path**: dabanzong/trending ## Basic Information - **Project Name**: trending - **Description**: 多平台热点聚合 · 一屏看尽全网热搜 - 微博/知乎/百度/B站/抖音/少数派/V2EX/GitHub Trending - **Primary Language**: Python - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2026-05-24 - **Last Updated**: 2026-05-24 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
# Trending Aggregator **多平台热点聚合 · 一屏看尽全网热搜** [![Python](https://img.shields.io/badge/Python-3.11+-blue.svg)](https://python.org) [![FastAPI](https://img.shields.io/badge/FastAPI-0.115-green.svg)](https://fastapi.tiangolo.com) [![Docker](https://img.shields.io/badge/Docker-Ready-2496ED.svg)](https://docker.com) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) **微博 · 知乎 · 百度 · B站 · 抖音 · 少数派 · V2EX · GitHub Trending** [在线演示](https://github.com/ydsgangge-ux/trending) · [快速开始](#-快速开始) · [功能特性](#-功能特性)

Made with ❤️ by ydsgangge

--- ## ✨ 为什么选这个? GitHub 上做热搜聚合的项目不少,但大多数都是: | 对比项 | 同类项目 | 本项目 | |--------|---------|--------| | 覆盖平台 | 2~4 个 | **8 个平台**一键聚合 | | 新上榜识别 | ❌ 没有 | ✅ **红色圆点实时标记新上榜条目** | | 热度趋势 | ❌ 没有 | ✅ **点击查看 24h 热度曲线** | | 前端技术 | Vue/React 需要编译 | **纯 HTML + Tailwind CDN,零构建** | | 部署方式 | 复杂的多容器编排 | **单 Dockerfile,docker run 即可** | | 数据库 | MySQL/PostgreSQL | **SQLite 零配置,单文件存储** | | 定时抓取 | 手动 cron 或没有 | **APScheduler 内置,各平台独立间隔** | | 启动方式 | 需要前后端分别启动 | **一条命令启动全栈服务** | > **新上榜高亮 + 热度历史曲线** 是同类项目几乎没做过的功能,但用户反馈最好。 --- ## 🚀 快速开始 ### 一键启动(最简单) **Windows**: 双击 `start.bat` **Mac / Linux**: ```bash chmod +x start.sh ./start.sh ``` > 脚本会自动检查 Python → 创建虚拟环境 → 安装依赖 → 启动服务 → 打开浏览器。 > > 指定端口:`./start.sh 3000` 或 `start.bat 3000` ### Docker 部署 ```bash git clone https://github.com/ydsgangge-ux/trending.git cd trending docker build -t trending . docker run -d -p 8000:8000 --name trending trending ``` ### 手动运行 ```bash git clone https://github.com/ydsgangge-ux/trending.git cd trending python -m venv .venv && source .venv/bin/activate # Windows: .venv\Scripts\activate pip install -r requirements.txt python -m uvicorn main:app --host 0.0.0.0 --port 8000 ``` 打开 `http://localhost:8000` 即可访问。 > **就是这么简单。没有 Node.js,没有 npm build,没有数据库安装。** --- ## 📋 功能特性 ### 📊 多平台聚合 | 平台 | 数据源 | 更新间隔 | |------|--------|---------| | 微博热搜 | weibo.com | 10 分钟 | | 知乎热榜 | zhihu.com | 15 分钟 | | 百度热搜 | baidu.com | 15 分钟 | | B站排行榜 | bilibili.com | 20 分钟 | | 抖音热搜 | douyin.com | 20 分钟 | | 少数派 | sspai.com (RSS) | 30 分钟 | | V2EX 热门 | v2ex.com | 30 分钟 | | GitHub Trending | github.com | 30 分钟 | ### 🆕 新上榜高亮 每次抓取自动与上一次对比,**新出现的条目用红点标记**,一眼就能看到变化。 ### 📈 热度趋势图 点击任意条目的趋势图标,查看 **过去 24 小时的热度变化曲线**(Chart.js 绘制)。 ### 🔄 自动刷新 前端每 60 秒自动轮询最新数据,无需手动刷新页面。 ### 📱 响应式设计 Tailwind CSS 实现,手机 / 平板 / 桌面全适配。 --- ## 🏗 技术栈 - **后端**: Python 3.11+ / FastAPI / httpx (异步) - **定时任务**: APScheduler - **数据库**: SQLite (零配置) - **前端**: 原生 HTML + Tailwind CSS CDN + Chart.js - **部署**: Docker (单文件) --- ## 📁 项目结构 ``` trending/ ├── main.py # FastAPI 入口 + APScheduler 定时任务 ├── models.py # 数据模型 (HotItem) ├── db.py # SQLite 操作 + 历史数据管理 ├── crawlers/ │ ├── base.py # 爬虫基类 (统一异常处理) │ ├── weibo.py # 微博热搜 │ ├── zhihu.py # 知乎热榜 │ ├── baidu.py # 百度热搜 │ ├── bilibili.py # B站排行榜 │ ├── douyin.py # 抖音热搜 │ ├── sspai.py # 少数派 (RSS) │ ├── v2ex.py # V2EX 热门 │ └── github.py # GitHub Trending ├── static/ │ └── index.html # 单页前端 ├── requirements.txt └── Dockerfile ``` --- ## 🔌 API 接口 | 方法 | 路径 | 说明 | |------|------|------| | GET | `/api/hot` | 全部热点(按平台分组) | | GET | `/api/hot?platform=微博` | 按平台筛选 | | GET | `/api/hot?category=科技` | 按分类筛选 | | GET | `/api/new` | 最近 1 小时新上榜 | | GET | `/api/platforms` | 所有平台列表及状态 | | GET | `/api/history/{item_id}` | 条目热度历史(折线图数据) | --- ## 🤝 参与贡献 欢迎 PR!只需注意: 1. 新增爬虫继承 `BaseCrawler`,实现 `fetch()` 方法 2. 在 `crawlers/__init__.py` 中注册 3. 请求频率不要太高(建议 ≥ 10 分钟间隔) 4. 只抓取公开数据,不涉及用户隐私 --- ## ⚖️ 免责声明 > 本项目仅用于**技术学习与学术交流**,所有数据均来自各平台公开接口和公开页面。 > > - 项目不存储任何用户个人信息 > - 不绕过任何平台的付费墙、登录验证或反爬措施 > - 每个平台的请求间隔 ≥ 10 分钟,远低于正常用户浏览频率 > - 如任何平台认为本项目存在不妥,请提交 Issue,我们会及时处理 > > **禁止将本项目用于任何商业用途。** 使用本项目所产生的一切法律后果,由使用者自行承担。 --- ## 📄 License [MIT](LICENSE) © 2024 [ydsgangge](https://github.com/ydsgangge-ux)