Last active
July 2, 2021 00:51
-
-
Save 582033/f0160fbdeede6f144c78642d0f71f467 to your computer and use it in GitHub Desktop.
12351工会福利抢购
This file contains 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
#!/usr/bin/env bash | |
#用户session | |
JSESSIONID="0003it-tqm1tI0yBdJiT4cnedEh:-HLGBUP:XXXXXXXX" | |
#活动id | |
service_id="32142" | |
#token | |
token="3BF2A6E0EA39BE2FC66A3C3A82XXXXXXX" | |
#收货人地址 | |
receive_id="1234567" | |
#收货人手机号 | |
phone="18515150000" | |
#奖品领取地点,736是中关村总工会地址 | |
firm_id="736" | |
#当前时间 | |
use_date=$(date "+%Y-%m-%d") | |
#签到,用于抢购成功后扫码确认 | |
signIn(){ | |
curl -s \ | |
-H 'Host: apphd.bjzgh12351.org' \ | |
-H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \ | |
-H 'Origin: file://' \ | |
-H "Cookie: JSESSIONID=$JSESSIONID" \ | |
-H 'Accept: application/json, text/plain, */*' \ | |
-H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 (5687519488)' \ | |
-H 'Accept-Language: zh-cn' \ | |
--data-binary "service_id=$service_id&token=$token&firm_id=$firm_id" \ | |
--compressed 'http://apphd.bjzgh12351.org/mobile/api/check/take-service.jsp' \ | |
| jq | |
} | |
#抢购 | |
snapUp(){ | |
for i in {1..200};do | |
curl -s \ | |
-H 'Host: apphd.bjzgh12351.org' \ | |
-H 'Content-Type: application/x-www-form-urlencoded;charset=utf-8' \ | |
-H 'Origin: file://' \ | |
-H "Cookie: JSESSIONID=$JSESSIONID" \ | |
-H 'Accept: application/json, text/plain, */*' \ | |
-H 'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 (4385191040)' \ | |
-H 'Accept-Language: zh-cn' \ | |
--data-binary "service_id=$service_id&token=$token&receive_id=$receive_id&use_date=$use_date&firm_id=$firm_id&reserve_count=1&phone=$phone" \ | |
--compressed 'http://apphd.bjzgh12351.org/mobile/api/service/reserve.jsp' \ | |
| jq 2>&1 & | |
done | |
} | |
if [[ $1 == "signIn" || $1 == "snapUp" ]];then | |
$1 | |
else | |
echo -e "\n参数错误,仅支持以下参数: \n - $0 snapUp, 抢购\n - $0 signIn, 抢购成功后的扫码确认\n"; | |
exit; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
基础信息部分需要自己抓包获取
jq命令非必须
| jq
这部分brew install jq
jq.exe
扩展; 下载链接使用
./12351.sh snapUp
进行抢购./12351.sh signIn
来替代抢购成功后的扫码操作tips