Last active
November 19, 2016 07:53
-
-
Save 599316527/6b018b76bd9118c753fd to your computer and use it in GitHub Desktop.
zimuzu.tv 签到脚本
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/sh | |
ACCOUNT="[email protected]" | |
PASSWORD="fuckccp!" | |
######################################### | |
function urlEncode() { | |
python -c " | |
import urllib, commands, os; | |
var = commands.getoutput('echo \'$1\''); | |
var = urllib.quote_plus(var); | |
os.system('echo ' + var);" | |
} | |
DOMAIN="http://www.zimuzu.tv" | |
COOKIE="zimuzu.cookie" | |
REMEMBER="1" | |
REDIRECT="$DOMAIN/user/sign" | |
ExpectedResponseText='{"status":0,"info":"","data":0}' | |
RetryCount=1 | |
# 登錄 | |
curl -d "account=$(urlEncode $ACCOUNT)&password=$(urlEncode $PASSWORD)&remember=$(urlEncode $REMEMBER)&url_back=$(urlEncode $REDIRECT)" \ | |
-c "$COOKIE" -s "$DOMAIN/User/Login/ajaxLogin" | |
echo '' | |
sleep 1 | |
# 要先打開簽到頁面 | |
curl -s --cookie "$COOKIE" "$REDIRECT" > /dev/null | |
curl -s --cookie "$COOKIE" "$DOMAIN/user/login/getCurUserTopInfo" | |
echo '' | |
# 等15秒再簽到 | |
sleep 15 | |
while true; do | |
Response=$(curl -s --cookie "$COOKIE" "$DOMAIN/user/sign/dosign") | |
echo "$(date '+%H:%M:%S') \t $RetryCount \t $Response"; | |
((RetryCount++)) | |
if [ "$Response" == "$ExpectedResponseText" -o "$RetryCount" -gt 6 ]; then | |
break | |
fi | |
sleep 2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
非常好用的脚本,签到成功!
感谢