Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge fron Dev #5

Merged
merged 12 commits into from
Dec 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: "GitHub Actions SMZDM Bot"
# events but only for the main branch
on:
push:
branches: [ main ]
# branches: [ main ]
pull_request:
branches: [ main ]
schedule:
Expand Down Expand Up @@ -38,4 +38,4 @@ jobs:
env:
COOKIES: ${{ secrets.SMZDM_COOKIE }}
SERVERCHAN_SECRETKEY: ${{ secrets.SERVERCHAN_SECRETKEY }}
run: python main.py >SMZDM_Bot.log
run: python main.py #>SMZDM_Bot.log
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<p align="center">
<img src="https://img.shields.io/badge/Created on-2020.10-green"/>
<img src="https://img.shields.io/badge/Python-3.7-blue"/>
<img src="https://img.shields.io/badge/Last commit-October-yellow"/>
<img src="https://img.shields.io/badge/Last commit-Dec.-yellow"/>
<img src="https://img.shields.io/badge/Repo size-35.8kb-red"/>
</p>

Expand Down Expand Up @@ -35,7 +35,12 @@


# N. Log
不清楚Cookie需多久更新一次,目前已连续正常签到25天
在没有更换`SMZDM_COOKIE`的情况下,截至2020-12-12, 我的账号已正常签到68天,具体`SMZDM_COOKIE`有效时间继续验证。
<img src="pics/log_20201212.jpg" width="300" height="200" alt="签到截图" div align=center /><br/>

+ 2020-10-08
first push

+ 2020-12-12
修复如果没有填写`SERVERCHAN_SECRETKEY`,会在正常签到后报错的问题。
现在没有`SERVERCHAN_SECRETKEY`也可以正常签到并不报错。
12 changes: 8 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,14 @@ def checkin(self):
sb = SMZDM_Bot()
# sb.load_cookie_str(config.TEST_COOKIE)
cookies = os.environ["COOKIES"]
SERVERCHAN_SECRETKEY = os.environ["SERVERCHAN_SECRETKEY"]
sb.load_cookie_str(cookies)
res = sb.checkin()
print(res)
push_to_wechat(text = '什么值得买每日签到',
desp = str(res),
secretKey = SERVERCHAN_SECRETKEY)
SERVERCHAN_SECRETKEY = os.environ["SERVERCHAN_SECRETKEY"]
print('sc_key: ', SERVERCHAN_SECRETKEY)
if isinstance(SERVERCHAN_SECRETKEY,str) and len(SERVERCHAN_SECRETKEY)>0:
print('检测到 SCKEY, 准备推送')
push_to_wechat(text = '什么值得买每日签到',
desp = str(res),
secretKey = SERVERCHAN_SECRETKEY)
print('代码完毕')
Binary file added pics/log_20201212.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.