Last active
June 16, 2022 10:46
-
-
Save ZE3kr/147403cb6c781dc8a1d01000ed199e95 to your computer and use it in GitHub Desktop.
北京工业大学 (正方教务系统) 选修课抢课脚本
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 北工大选课软件 | |
export ALL_PROXY="" | |
b="" | |
# 需要改三个地方 | |
# 1. 替换 URL | |
url="http://gdjwgl.bjut.edu.cn/xf_xsqxxxk.aspx?xh=18080108&xm=%B9%F9%D4%F3%D3%EE&gnmkdm=N121113" | |
# 2. 替换 POST 的数据 | |
data="__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff&ddl_kcxz=&ddl_ywyl=&ddl_kcgs=&ddl_xqbs=1&ddl_sksj=&TextBox1=%BB%B7%BE%B3%BE%AD%BC%C3&kcmcGrid%3A_ctl2%3Axk=on&dpkcmcGrid%3AtxtChoosePage=1&dpkcmcGrid%3AtxtPageSize=15&Button1=++%CC%E1%BD%BB++" | |
while ["${b}" == ''] | |
do | |
# 3. 更新 COOKIE 值 | |
r=`curl -s -X POST -H "Cookie: ASP.NET_SessionId=ffffffffffffffffffffffff" --data "$data" "$url" | iconv -f gbk | grep "alert"` | |
b=`echo $r | grep "冲突"` | |
if ["${b}" == '']; then | |
date '+%Y-%m-%d %H:%M:%S❌' | |
echo $r | |
sleep 3 | |
else | |
echo ✅选课成功 | |
sleep 60 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment