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

mpg123 is much better than cvlc.

parent 14f22788
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ Linux. curl. fish. awk. One mp3 player available on command line. ...@@ -15,7 +15,7 @@ Linux. curl. fish. awk. One mp3 player available on command line.
d.fish使用了gnome的notify-send,kde/其他de用户请根据自己的情况选择修改或删除气泡提醒。 d.fish使用了gnome的notify-send,kde/其他de用户请根据自己的情况选择修改或删除气泡提醒。
d.fish使用了cvlc来播放mp3,其他播放器用户请根据自己情况进行修改。请将电脑声音调大。 d.fish默认使用mpg123/cvlc来播放mp3,其他播放器用户请根据自己情况进行修改。请将电脑声音调大。
## Tips ## Tips
......
...@@ -2,7 +2,10 @@ ...@@ -2,7 +2,10 @@
#Usage: fill _url with url of the page "学生->答题". #Usage: fill _url with url of the page "学生->答题".
#You must `echo "known" > /tmp/gay_known` to tell the script that you've been informed. #You must `echo "known" > /tmp/gay_known` to tell the script that you've been informed.
set _url 'https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=161067e64d98cbb23d3ceb2947f004a8' set _url 'https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=0a26740fbf9429d1747f8bc8ff8bf1cb'
set _audio_player "mpg123"
#set _audio_player "cvlc --play-and-exit"
function _is_informed function _is_informed
# May not exist. # May not exist.
...@@ -20,13 +23,13 @@ function _on_opened ...@@ -20,13 +23,13 @@ function _on_opened
if _is_informed if _is_informed
return 0 return 0
end end
cvlc --play-and-exit fire.mp3 > /dev/null 2>&1 eval $_audio_player fire.mp3 > /dev/null 2>&1
notify-send "Warning: Question opened!" "Gay question opened!" notify-send "Warning: Question opened!" "Gay question opened!"
echo "LOG> Detected!" echo "LOG> Detected!"
end end
function _on_error function _on_error
cvlc --play-and-exit error.mp3 > /dev/null 2>&1 eval $_audio_player error.mp3 > /dev/null 2>&1
notify-send "Warning: Gay cookie invalid!" "Gay cookie expired!" notify-send "Warning: Gay cookie invalid!" "Gay cookie expired!"
echo "LOG> Error occurred! Maybe invalid cookie." echo "LOG> Error occurred! Maybe invalid cookie."
end end
......
...@@ -5,10 +5,15 @@ BEGIN { ...@@ -5,10 +5,15 @@ BEGIN {
} }
{ {
if (match($0, "\"msg\":\"unauthorized\"") != 0) {
a = 999
exit 2
}
if (match($0, "以下课堂包含开启的题目") != 0) { if (match($0, "以下课堂包含开启的题目") != 0) {
a = 1 a = 1
exit 0 exit 1
} }
if (match($0, "以下课堂暂未开启题目") != 0) { if (match($0, "以下课堂暂未开启题目") != 0) {
a = 1 a = 1
} }
......
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