├── .gitattributes ├── LICENSE ├── README.md ├── config.toml └── mycheckbox.sh /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-language=Go 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Ecalose 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # pt站签到,保活;阿里云盘签到;discuz论坛签到 2 | ## 仅供学习参考,请下载后24小时内删除,严禁用于一切侵权、侵害他人利益、违法违禁等不当行为;使用本软件造成的一切后果由用户自行承担,请悉知! 3 | 4 | ### 目前适配站点: 5 | * ptschool 6 | * 馒头 (mteam) 7 | * 老师 (nicept) 8 | * 其他与上述pt站链接后缀一致的(如老师的“/attendance.php”),改下host即可 9 | * 阿里云盘 10 | * discuz论坛 11 | * 请求为get类型的签到站点(不仅限于pt站点,目前仅通过响应头判断是否成功) 12 | * 请求为post类型,数据类型为application/x-www-form-urlencoded的站点(通过正则判断推送内容,无匹配项则推送签到失败) 13 | ### 目前适配通知: 14 | * 企业微信 15 | * telegram bot 16 | ### 使用说明: 17 | [release](https://github.com/Ecalose/MyCheckBox/releases/latest)下载对应平台二进制文件,配置好config.toml放于同一目录即可,可以用crontab/qinglong等设置定时,或使用-t 的flag设置定时,已适配多账号(因同ip导致的风险自行承担) 18 | 19 | (PS:go练手作品,代码太烂了就不放出来了) 20 | ### 青龙拉取命令 21 | ``` 22 | ql repo "https://github.com/Ecalose/MyCheckBox.git" "sh" "" "" "main" "" 23 | ``` 24 | config.sh内的RepoFileExtensions需加入sh,如:RepoFileExtensions="js pl py sh ts" 25 | ### 命令行参数 26 | * -t 后接cron表达式,如"59 23 * * *",精确到分,设置定时(不依赖系统的crontab) 27 | 示例: ./mycheckbox -t "59 23 * * *" (英文引号不能忘) 28 | 29 | ### 配置说明 30 | * name 通知名称(必填) 31 | * url 将host一词替换为网址(必填) 32 | * cookie 站点cookie(必填) 33 | * proxy 代理链接(http/socks5) 34 | * 企业微信推送仅需填写corpid、corpsecret两项(如无需则可不填) 35 | * 其余详见config.toml内说明 36 | * refresh_token 阿里云盘,抓取教程可以参考该[链接](https://alist.nn.ci/zh/guide/drivers/aliyundrive.html) 37 | 38 | ### 适配计划 39 | pt站目前手上就这三个号,所以也就适配了这三个站,其他的等有了药再说( 40 | 41 | ### 运行效果展示 42 | ![image](https://user-images.githubusercontent.com/47114714/230721109-0bc6d9a0-f2b1-47f2-a7e8-6260f1f4b39f.png) 43 | 44 | ![Screenshot_2023-02-10-10-42-16-435_com tencent wework](https://user-images.githubusercontent.com/47114714/217987149-047880d4-2eb4-4c77-b468-59b0fae204bd.png) 45 | 46 | ![image](https://user-images.githubusercontent.com/47114714/218293924-ba9e4317-3725-4e69-9c35-9ac504064d4c.png) 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /config.toml: -------------------------------------------------------------------------------- 1 | # 杂项 2 | [common] 3 | proxy="" 4 | 5 | # 企业微信 6 | [wxconfig] 7 | msgtype="" 8 | corpid="" 9 | corpsecret="" 10 | title="" 11 | msg="" 12 | 13 | # telegram bot 14 | [tgconfig] 15 | bottoken="" 16 | userid="" 17 | msg="" 18 | 19 | # get类站点 20 | [[get]] 21 | name="" 22 | url="" 23 | cookie="" 24 | [[get]] 25 | name="" 26 | url="" 27 | cookie="" 28 | ua="" 29 | 30 | # 馒头 31 | [[mteam]] 32 | name="馒头1" 33 | url="host/index.php" 34 | cookie="" 35 | [[mteam]] 36 | name="馒头2" 37 | url="" 38 | cookie="" 39 | 40 | # 学校 41 | [[ptschool]] 42 | name = "ptschool" 43 | url = "host/index.php?action=addbonus" 44 | cookie="" 45 | ua="" 46 | # 老师 47 | [[nicept]] 48 | name="" 49 | url="host/attendance.php" 50 | cookie="" 51 | 52 | # 阿里云盘 53 | [[alicloud]] 54 | name="阿里云盘" 55 | refresh_token="" 56 | 57 | # discuz论坛(post类) 58 | [[post]] 59 | name = "" 60 | url = "" 61 | cookie="" 62 | data="" 63 | # 已签到的正则表达式 64 | DoneRegex="今日已经签过到" 65 | # 签到成功的正则表达式 66 | SuccessRegex="签到成功" 67 | ua="" 68 | -------------------------------------------------------------------------------- /mycheckbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # cron "15 7 * * *" script-path=xxx.sh,tag=匹配cron用 4 | # const $ = new Env('MyCheckBox'); 5 | # ------------------------------- 6 | case $(uname -m) in 7 | x86_64) arch=amd64;; 8 | aarch64) arch=arm64;; 9 | mips64) arch=mipsle;; 10 | esac 11 | echo "系统架构为$arch,开始下载最新checkbox" 12 | link="https://github.com/Ecalose/MyCheckBox/releases/latest/download/mycheckbox-$arch" 13 | wget -q -O /ql/data/scripts/Ecalose_MyCheckBox_main/mycheckbox $link 14 | FILE=/ql/data/scripts/Ecalose_MyCheckBox_main/config.toml 15 | 16 | if [ ! -f "$FILE" ]; then 17 | echo "配置文件不存在,开始下载配置文件,位置为/ql/data/scripts/Ecalose_MyCheckBox_main/config.toml" 18 | wget -q -O /ql/data/scripts/Ecalose_MyCheckBox_main/config.toml "https://raw.githubusercontent.com/Ecalose/MyCheckBox/main/config.toml" 19 | fi 20 | echo "开始签到" 21 | chmod +x /ql/data/scripts/Ecalose_MyCheckBox_main/mycheckbox && /ql/data/scripts/Ecalose_MyCheckBox_main/mycheckbox 22 | --------------------------------------------------------------------------------