Skip to content
Snippets Groups Projects
Unverified Commit b7957f66 authored by Recolic Keghart's avatar Recolic Keghart
Browse files

add signin monitor

parent 4b559acb
No related branches found
No related tags found
No related merge requests found
File moved
......@@ -2,12 +2,13 @@
#Usage: fill _openid with openid from url of the page "学生->答题".
set _openid ''
set _url "https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
test "$_openid" = ""; and echo 'Give openid or url please:'; and read _openid
set _openid (echo "$_openid" | sed 's/^.*openid=//g')
echo "Set openid to $_openid"
set _url "https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
set _audio_player "mpg123"
#set _audio_player "cvlc --play-and-exit"
......@@ -16,7 +17,7 @@ function _check_and_warn
echo "LOG> exit because all question answered."
return 0
end
eval $_audio_player fire.mp3 > /dev/null 2>&1
eval $_audio_player answer.mp3 > /dev/null 2>&1
notify-send "Warning: Question opened!" "Question opened!"
echo "LOG> Detected!"
end
......
#!/usr/bin/fish
set _openid ''
test "$_openid" = ""; and echo 'Give openid or url please:'; and read _openid
set _openid (echo "$_openid" | sed 's/^.*openid=//g')
echo "Set openid to $_openid"
set _url "https://www.teachermate.com.cn/wechat/wechat/guide/signin?openid=$_openid"
set _audio_player "mpg123"
#set _audio_player "cvlc --play-and-exit"
set tmpfl (mktemp)
while true
curl "$_url" 2>/dev/null > $tmpfl
if grep '{"data":\[\],"msg":"unauthorized"}' $tmpfl
mpg123 error.mp3
sleep 5
continue
end
if not grep "<p class='success-tip'>暂无签到开启</p>" $tmpfl
mpg123 qiandao.mp3
end
sleep 5
end
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment