Files
cksd/README.md
2025-12-17 21:50:02 +08:00

69 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
## 城科水电监控
**进行水费和电费的实时监控程序, 默认获取前24条数据进行绘图**
### 实现功能
- 获取**水费**和**电费**使用情况
- 使用 `matplotlib` 进行绘图可视化
- 使用企业微信机器人进行推送图片
### 使用
- 修改配置文件(二选一即可)
1.`.env.example` 复制为 `.env`
- 手动去 Github 下载 [LXGWWenKai-Medium 字体](https://github.com/lxgw/LxgwWenKai) 保存到fonts文件夹中或者使用 wget 进行获取,然后修改配置文件
```sh
curl -L -o ./fonts/LXGWWenKaiMono-Medium.ttf https://github.5700.cf/https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/LXGWWenKaiMono-Medium.ttf
```
- `UID` 获取,使用支付宝进行扫描下方二维码即可获得 `uid`
![UID 获取](./images/image.png)
- `USER_NO` 获取,通过抓包获取,使用抓包软件进行抓取微信小程序**扫呗团餐**,对响应体进行搜索`user_no`即可
![USER_NO 获取](./images/image2.png)
- `SCHOOL_ACCOUNT` 这是学号(可选)
- `USER_NAME` 这是姓名(可选)
- `WECHAT_COMANY_BOT_KEY` 企业微信机器人 key
2. 配置当前目录下的 `config.py` 文件
- 手动去 Github 下载 [LXGWWenKai-Medium 字体](https://github.com/lxgw/LxgwWenKai) 保存到fonts文件夹中或者使用 wget 进行获取,然后修改配置文件
```sh
curl -L -o ./fonts/LXGWWenKaiMono-Medium.ttf https://github.5700.cf/https://github.com/lxgw/LxgwWenKai/releases/download/v1.521/LXGWWenKaiMono-Medium.ttf
```
- `UID` 获取,使用支付宝进行扫描下方二维码即可获得 `uid`
![UID 获取](./images/image.png)
- `USER_NO` 获取,通过抓包获取,使用抓包软件进行抓取微信小程序**扫呗团餐**,对响应体进行搜索`user_no`即可
![USER_NO 获取](./images/image2.png)
- `SCHOOL_ACCOUNT` 这是学号(可选)
- `USER_NAME` 这是姓名(可选)
- `WECHAT_COMANY_BOT_KEY` 企业微信机器人 key
- 安装依赖
```sh
pip install aiosqlite apscheduler httpx matplotlib dotenv
```
- 通过 `scheduler.py` 修改监控时长配置(不懂的请问 AI
### 📜 License
This project is licensed under the [MIT License](LICENSE).