Created
March 4, 2018 11:54
-
-
Save pexcn/2b646ab944967c0f32fb2706aef30470 to your computer and use it in GitHub Desktop.
china unicom mobile client auto sign script
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
#!/bin/bash -xe | |
# Replace ******** with your token | |
export SIGN_IN_URL=http://m.client.10010.com/SigninApp/signin/querySigninActivity.htm?token=******** | |
export DAY_SIGN_URL=http://m.client.10010.com/SigninApp/signin/daySign.do | |
export SCRIPT_PATH=$(dirname $0) | |
echo "$(date +'%Y-%m-%d %T')" >> $SCRIPT_PATH/log.txt | |
curl $SIGN_IN_URL \ | |
-H "Host: m.client.10010.com" \ | |
-H "Origin: null" \ | |
-H "Upgrade-Insecure-Requests: 1" \ | |
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ | |
-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 unicom{version:[email protected]}" \ | |
-H "Accept-Language: zh-cn" \ | |
-H "Accept-Encoding: gzip, deflate" \ | |
-H "Connection: keep-alive" \ | |
--cookie-jar $SCRIPT_PATH/cookie.txt \ | |
--silent --output /dev/null | |
curl $DAY_SIGN_URL \ | |
-H "Host: m.client.10010.com" \ | |
-H "Origin: null" \ | |
-H "Upgrade-Insecure-Requests: 1" \ | |
-H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" \ | |
-H "User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 11_2_6 like Mac OS X) AppleWebKit/604.5.6 (KHTML, like Gecko) Mobile/15D100 unicom{version:[email protected]}" \ | |
-H "Accept-Language: zh-cn" \ | |
-H "Accept-Encoding: gzip, deflate" \ | |
-H "Connection: keep-alive" \ | |
--cookie $SCRIPT_PATH/cookie.txt \ | |
--silent >> $SCRIPT_PATH/log.txt | |
echo -e "\n" >> $SCRIPT_PATH/log.txt | |
if [ -f $SCRIPT_PATH/cookie.txt ]; then | |
rm $SCRIPT_PATH/cookie.txt | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment