Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ManiaciaChao/yatm
yet another teachermate helper
https://github.com/ManiaciaChao/yatm
Last synced: 3 months ago
JSON representation
yet another teachermate helper
- Host: GitHub
- URL: https://github.com/ManiaciaChao/yatm
- Owner: ManiaciaChao
- Created: 2020-09-17T02:58:19.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-08T11:46:01.000Z (6 months ago)
- Last Synced: 2024-05-12T17:35:26.726Z (6 months ago)
- Language: TypeScript
- Size: 233 KB
- Stars: 71
- Watchers: 3
- Forks: 10
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-hust - yatm
README
Welcome to yatm 👋
> yet another teachermate helper
## Features
- Multi-mode sign-in support: normal, GPS and QR code.
- Automatically sign in **WITHOUT any assistance** from your classmates
- System-level notification support (test on windows 10 & macOS & gnome)
- Active development
-Docker supportIncoming!## Install
Simply download the latest release.
or you can build on your own.
```sh
yarn install
yarn build
```## Configuration
Create a `config.json` fisrt:
```bash
cp sample.config.json config.json
```**Then edit it:**
```javascript
{
"interval": 10000, // 签到检测轮询间隔,单位 ms
"wait": 5000, // 检测到签到后等待时长,单位 ms
// 用于 GPS 签到(大概是 Google 坐标)
"lat": 30.511227, // 纬度
"lon": 114.41021, // 经度
//剪贴板指令
"clipboard": { // 读写剪贴板的 CLI command
"paste": "pbpaste", // 若不为空,则优先尝试从剪贴板获取 openId
"copy": "echo {} | pbcopy", // qr.mode == "copy" 时启用,{} 为占位符
},
"qr": { // 用于二维码签到
// 模式
// terminal: 终端打印二维码,微信扫码
// plain: 终端打印签到URL,微信打开
// copy:同 plain,并复制到剪贴板
"mode": "terminal",
}
"ua": "" // 建议使用自己的微信 UA
}```
## Usage
### Get your `openId`
Get your `openId` from WeChat official account `微助教服务号`. [How?](./docs/AcquireOpenID.md)
**Notice that `openId` will expire after thousands of requests or another entrace from WeChat.**
### Run the script
Run the script, then paste your `openId` into console:
```sh
yarn start
```or with environments:
```sh
env OPEN_ID=${your openId} yarn start
```For normal & GPS sign-in, the process is automatic. You don't need to care about anything.
If the `openId` is expired or invaild, you'll get a notification :)
### For QR Code sign-in
Due to the limitation of WeChat API, things are quite different for QR code sign-in.
The script will subscribe the sign-in URL generated by teachermate's server, and print its corresponding QR code to the console when it updates.
You're expected to scan the QR code **manually via WeChat** from your console.
Attention that **the script WILL EXIT INSTANTLY when success, because a QR scan
via WeChat will causes the update of `openId`. You have to reacquire your new
`openId` and run this script again!**### *Experimental* Devtools Protocol
Due to the limitation of WeChat API, the following WeChat-related processes can't be simulated:
* generate new `openId`
* simulate the QR scanningHowever, [Devtools Protocol](https://chromedevtools.github.io/devtools-protocol/) can help automatize the whole thing.
Check [this](./docs/DevtoolsProtocol.md) for more details.
## Author
👤 **maniacata**
- Website: http://blog.plus1sec.cn
- Github: [@ManiaciaChao](https://github.com/ManiaciaChao)## Show your support
Give a ⭐️ if this project helped you!
---
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_