# HotList **Repository Path**: xaviw/hot-list ## Basic Information - **Project Name**: HotList - **Description**: 热点聚合系统 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2021-03-04 - **Last Updated**: 2024-12-26 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 热点聚合系统 #### 介绍 爬取榜单并展示,提供用户模块、收藏、订阅、搜索、反馈、切换排序功能 ![](https://images.gitee.com/uploads/images/2021/0304/124910_9d760743_7805004.png "屏幕截图.png") #### 系统环境 - Windows 10 64 位 - Python 3.7.6 - Node.js 14.15.4 - MongoDB 4.4.3 #### 项目架构 - Scrapy 爬虫 + Express 后端 + Vue 前端 - (可选)scrapyd + scrapydweb 管理爬虫定时运行 #### 安装流程 1. 安装好如上系统环境 2. MongoDB 中创建 hotlist_today 库,创建 site 表并导入 MongoDB.json 数据 3. 安装 ChromeDriver:[教程](https://www.jianshu.com/p/28c0d1ed62f8) 4. spider 目录下 ```bash pip install pipenv pipenv install scrapy crawlall ``` 5. Web/vue 目录下 ```bash npm i npm run build ``` 6. Web/express 目录下 ``` npm i ``` 修改 config.js 文件中密钥,内容如下: ```JavaScript const mongoUri = "mongodb://127.0.0.1:27017/hotlist_today"; // mongo数据库地址 const saltRounds = 8; // 用户密码Bcrypt加密级别 const secret = "xxxx"; // JWT密钥 // 百度云文本审核密钥 const BAIDU_APP_ID = "xxxx"; const BAIDU_API_KEY = "xxxx"; const BAIDU_SECRET_KEY = "xxxx"; module.exports = { mongoUri, saltRounds, secret, BAIDU_APP_ID, BAIDU_API_KEY, BAIDU_SECRET_KEY, }; ``` ```bash node index.js ``` #### 爬虫管理(可选) 1. 注释 Spider/HotList/settings.py 中
`COMMANDS_MODULE = 'HotList.commands'` 2. Spider 目录下执行 ```bash scrapyd ``` 3. pipenv 虚拟环境根目录下创建 scrapyd-deploy.bat(可以搜索 scrapy-deploy,或者目录查找,我电脑目录为 C:\Users\xxx\\.virtualenvs\spider2-swZ12mmV\Scripts),记事本修改内容为: ``` @echo off "D:\Program Files\Python37\python.exe" "D:\Program Files\Python37\Scripts\scrapyd-deploy" %1 %2 %3 %4 %5 %6 %7 %8 %9 ``` 4. Spider 目录下执行 ```bash scrapyd-deploy graduate -p HotList ``` 5. 按[ScrapydWeb 配置教程](https://zhuanlan.zhihu.com/p/99449687),配置 ScrapydWeb 6. 进入 http://127.0.0.1:5000 管理爬虫