全部博文(298)
分类: Python/Ruby
2012-05-06 16:16:52
Shell利用飞信给自己发短信
整理自:http://blog.csdn.net/maxjove/article/details/7211337
#!/bin/sh #Convert Python Fetion To Shell @2012
user='xxxxxxxxx' #飞信账号 一般是你的手机号 password='xxxxx' #飞信密码,但愿只有你自己知道. loginstatus='4' url_login='' url_logout='' url_msg='' TempDir='shfethionTmp'
read -p "please enter :" msg echo $msg if [ -d "$TempDir" ]; then rm -rf ${TempDir} mkdir "$TempDir" else mkdir "$TempDir" fi wget -q -P ${TempDir} --save-cookies=${TempDir}/cookie --keep-session-cookies --post-data "m=${user}&pass=${password}&loginstatus=${loginstatus}" ${url_login} url=`grep -Eo ' arg_t=`grep -Eo
' echo $url if [ "${url}" = '/im/login/login.action' ];then echo 'Login Failed!' exit 0 else echo 'Login Successfully!' fi wget -q -P ${TempDir} --load-cookies=${TempDir}/cookie --keep-session-cookies --post-data "msg=${msg}" ${url_msg} echo $arg_t wget -q -P ${TempDir} --load-cookies=${TempDir}/cookie --keep-session-cookies --post-data "${arg_t}" ${url_logout} echo 'Logout Successfully!' rm -rf ${TempDir} |