Skip to content

Commit

Permalink
#6 升级 Server 酱新版推送通道
Browse files Browse the repository at this point in the history
  • Loading branch information
PrintNow committed Mar 21, 2021
1 parent 9089b8a commit 8a01fca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 6 deletions.
10 changes: 8 additions & 2 deletions Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@
'SERVER_CHAN' => [
'这里填你的超星账号 1' => [
'state' => true,//是否启用 Server酱 通知,true: 启用 false: 不启用
'SCKEY' => '',//在 http://sc.ftqq.com/?c=code 获取

//填入该值,表示你使用的是新版推送通道。旧版推送通道将于 2021年4月 下线
//SendKey 获取地址:https://sct.ftqq.com/sendkey
'SendKey' => '',
],
'这里填你的超星账号 2' => [
'state' => true,//是否启用 Server酱 通知,true: 启用 false: 不启用
'SCKEY' => '',//在 http://sc.ftqq.com/?c=code 获取

//填入该值,表示你使用的是新版推送通道。旧版推送通道将于 2021年4月 下线
// SendKey 获取地址:https://sct.ftqq.com/sendkey
'SendKey' => '',
],
//... 多账号部署
],
Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ PHP 版超星学习用自动签到,支持多用户签到,二次开发便捷
支持普通签到,手势签到,~~二维码签到~~,位置签到,~~拍照签到~~

# 🎨 更新日志
<details open>
<summary>2021/03/21</summary>

- <a href="https://github.com/PrintNow/ChaoxingSign/issues/6">#6</a> 升级为新版 Server 酱推送通道,原因:微信发布公告将在2021年4月底下线模板消息,故旧版推送通道将于 2021年4月 下线
> 获取本源码后,请配置 `Config.php` 的相关配置
</details>

<details open>
<summary>2020/06/13</summary>

Expand All @@ -20,7 +27,7 @@ PHP 版超星学习用自动签到,支持多用户签到,二次开发便捷
- 添加 获取课程列表失败,重试2次以判断是API错误
</details>

<details open>
<details>
<summary>2020/05/27</summary>

- 修复 <a href="https://github.com/PrintNow/ChaoxingSign/issues/1">#1</a>
Expand Down
3 changes: 1 addition & 2 deletions lib/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ function sc_send($text = '', $desp = '', $key = '')
);
$context = stream_context_create($opts);

$result = json_decode(@file_get_contents('https://sc.ftqq.com/' . $key . '.send', false, $context), true);
return $result;
return json_decode(@file_get_contents('https://sctapi.ftqq.com/' . $key . '.send', false, $context), true);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion main.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
$req = sc_send(
"超星自动签到成功",
str_replace("\n", "\n\n", $msgTmp),//因为 Server酱 两个换行才是换行
$config['SERVER_CHAN'][$account]['SCKEY']
$config['SERVER_CHAN'][$account]['SendKey']
);

if(!isset($req['errmsg'])){
Expand Down

0 comments on commit 8a01fca

Please sign in to comment.