diff --git a/README.md b/README.md
index e29e3a4692974717f570cfa352f1ed7625fd64a4..b7df9b7576b4b949f3c64e3d324f6069b7bacb16 100644
--- a/README.md
+++ b/README.md
@@ -1,23 +1,37 @@
 # micro-teaching-assistant-fucker
 
+微助教工具箱
+
 自动检测是否有老师在微助教发布了新的题 并在特殊情况下及时提醒答题
 
-自动检测是否有老师在微助教发布了新的签到 并在特殊情况下及时提醒签到
+自动检测是否有老师在微助教发布了新的签到 并延时自动签到
 
 ## Hard PreRequirements
 
-Non-Windows OS. curl. bash. fish. awk. One mp3 player available on command line.
+Non-Windows OS. curl. bash. fish. awk. grep. One mp3 player available on command line.
+
+## Configuration
+
+编辑config.fish,设置自动签到的经纬度和延时,设置你想使用的mp3播放器然后保存。
 
 ## Usage
 
-打开微信 微助教 学生 答题/签到,在页面加载完成之前迅速按下右上角...,然后复制这个页面的url。
+- 获得openid
 
-运行你想要的daemon.sh 输入openid或含有openid的完整URL 它会每5秒检查一次并判断是否需要答题/签到。你也可以将openid直接写进daemon.sh。
+打开微信 微助教 学生 答题/签到,在*页面加载完成之前*迅速按下右上角的`...`,然后复制链接(copy url)。
 
-daemon.sh使用了notify-send,其他用户请根据自己的情况选择修改或删除气泡提醒。
+- 自动签到
 
-daemonx.sh默认使用mpg123/cvlc来播放mp3,其他播放器用户请根据自己情况进行修改。**请将电脑声音调大**。
+运行`./daemon.sh sign`并填写openid(或含有openid的url),它会监视你的所有课堂并自动签到。注意,如果有多个课堂同时发起签到请求,其行为是未定义的。
+
+- 监视答题
+
+运行`./daemon.sh ans`(或含有openid的url),它会监视你的所有课堂是否有答题。注意,如果有多个课堂同时发起答题,其行为是未定义的。
 
 ## Tips
 
-根据经验,url一般会在约1080次请求后失效。这意味着,如果你只开一个脚本,5秒请求一次,它可以使用约90分钟。同时使用签到和答题监测时,时间会减半。
+daemon.sh使用了notify-send,其他用户请根据自己的情况选择修改或删除气泡提醒。
+
+daemonx.sh默认使用mpg123/cvlc来播放mp3,其他播放器用户请根据自己情况进行修改。**请将电脑声音调大**。
+
+根据经验,url一般会在约1080次请求后失效。这意味着,如果你只开一个脚本,5秒请求一次,它可以自动运行约90分钟。
diff --git a/config.fish b/config.fish
new file mode 100644
index 0000000000000000000000000000000000000000..17231b25a2146cd9ec5ff11359f220b56b1e0668
--- /dev/null
+++ b/config.fish
@@ -0,0 +1,13 @@
+# What mp3 player do you want? (Tip, you can write a wrapper here to set player to highest volume)
+#set _audio_player="mpg123"
+set _audio_player "cvlc --play-and-exit"
+
+# Where should I signin ?
+set _NorthLatitude "30.509604"
+set _EastLongitude "114.41374"
+
+# How many seconds should I sleep after every check ?
+set _monitor_interval "5"
+
+# How many seconds should I delay before autosign ?
+set _autosign_delay "10"
diff --git a/daemon.sh b/daemon.sh
index 41efe08917ea78f5bd481c168b29d8a947d3d4e2..ed5ac4921b1ecaf77a907a698cd5d112efc234b6 100755
--- a/daemon.sh
+++ b/daemon.sh
@@ -6,9 +6,6 @@
 _openid=$(echo "$_openid" | sed 's/^.*openid=//g')
 echo "Set openid to $_openid"
 
-#_audio_player="mpg123"
-_audio_player="cvlc --play-and-exit"
-
 function _segfault_detected () {
     echo "WARNING: segfault captured!"
     while true; do
@@ -27,12 +24,12 @@ fi
 cd impl
 
 if [[ $1 == sign ]]; then
-    _openid="$_openid" _audio_player="$_audio_player" ./daemon-signin.fish
+    _openid="$_openid" ./daemon-signin.fish
     [[ $? == 127 ]] && exit 127
     _segfault_detected
 fi
 if [[ $1 == ans ]]; then
-    _openid="$_openid" _audio_player="$_audio_player" ./daemon-answer.fish
+    _openid="$_openid" ./daemon-answer.fish
     [[ $? == 127 ]] && exit 127
     _segfault_detected
 fi
diff --git a/impl/autosignin-success.mp3 b/impl/autosignin-success.mp3
new file mode 100644
index 0000000000000000000000000000000000000000..e471c40db2c948fdf799f19d53617f391a63ea59
Binary files /dev/null and b/impl/autosignin-success.mp3 differ
diff --git a/impl/daemon-answer.fish b/impl/daemon-answer.fish
index 2925801e3804e403b7c46c8c2c40c737df0bfa23..5e1079cd50b2115333c42d455a23e72952d84460 100755
--- a/impl/daemon-answer.fish
+++ b/impl/daemon-answer.fish
@@ -1,7 +1,10 @@
 #!/usr/bin/fish
 #Usage: fill _openid with openid from url of the page "学生->答题".
 
-_url="https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
+test -z $_openid; and echo 'openid is unset.' ; and exit 1
+set _url "https://www.teachermate.com.cn/wechat/wechat/guide/answer?openid=$_openid"
+
+source ../config.fish
 
 function _check_and_warn
     if _all_answered
@@ -74,7 +77,7 @@ while true
     else if test "$_status" = "OPENED"
         _check_and_warn
     end
-    sleep 5
+    sleep $_monitor_interval
 end
 
 
diff --git a/impl/daemon-signin.fish b/impl/daemon-signin.fish
index 45eca316a00cd758824c184ca34acaf9e1a57b8c..9b9e58615a5326021135512ab004fa5333b06df5 100755
--- a/impl/daemon-signin.fish
+++ b/impl/daemon-signin.fish
@@ -1,21 +1,47 @@
 #!/usr/bin/fish
 
-_url="https://www.teachermate.com.cn/wechat/wechat/guide/signin?openid=$_openid"
+test -z $_openid; and echo 'openid is unset.' ; and exit 1
+set _url "https://www.teachermate.com.cn/wechat/wechat/guide/signin?openid=$_openid"
+
+source ../config.fish
+
+# Where should I signin ?
+test -z $_NorthLatitude; and set _NorthLatitude "30.509604"
+test -z $_EastLongitude; and set _EastLongitude "114.41374"
+
+# How many seconds should I delay before autosign ?
+test -z $_autosign_delay; and set _autosign_delay "10"
 
 set tmpfl (mktemp)
+set cookiefl (mktemp)
+# Just to skip first sleep
 rm $tmpfl
 
+set signed_in false
+
+function do_signin
+    if test $signed_in = true
+        return
+    end
+    echo "sleep for $_autosign_delay seconds..."
+    sleep $_autosign_delay
+    set _courseid (curl "$_url" -v 2>&1 | grep '^< Location: ' | sed 's/^.*course_id=//')
+    set _wx_csrf (grep 'Set-Cookie' $cookiefl | sed 's/^.*wx_csrf_cookie=//' | sed 's/;.*$//')
+    curl "https://www.teachermate.com.cn/wechat-api/v1/class-attendance/student-sign-in" --data "openid=$_openid&course_id=$_courseid&lon=$_EastLongitude&lat=$_NorthLatitude&wx_csrf_name=$_wx_csrf" > $cookiefl
+    grep -F 'repeat sign in' $cookiefl; and set signed_in true; and return
+    grep -F '":["OK",' $cookiefl; and set signed_in true; and eval $_audio_player autosignin-success.mp3; or eval $_audio_player signin.mp3
+end
+
 while true
-    test -f $tmpfl; and sleep 5
+    test -f $tmpfl; and sleep $_monitor_interval
     date
-    curl -L "$_url" 2>/dev/null > $tmpfl
+    curl -L "$_url" -v 2>$cookiefl > $tmpfl
     if grep '{"data":\[\],"msg":"unauthorized"}' $tmpfl
-        mpg123 badid.mp3
+        eval $_audio_player badid.mp3
         continue
     end
     if grep '签到中...' $tmpfl
-        echo 'got'
-        mpg123 signin.mp3
+        do_signin
         continue
     end
     if grep "<p class='success-tip'>暂无签到开启</p>" $tmpfl