利用飞信给自己发短信的Shell脚本
利用飞信给自己发短信的shell脚本翻译自一个Python脚本因为openwrt要装python太大了.所以用了两天非工作时间 翻译成了 shell脚本 .目前测试可用.
具体下载目录在 /2012年资料/1月/26日/利用飞信给自己发短信的Shell脚本/
- #!/bin/sh
- #Convert Python Fetion To Shell @2012
- user='xxxxxxxxx' #飞信账号 一般是你的手机号
- password='xxxxx' #飞信密码,但愿只有你自己知道.
- loginstatus='4'
- url_login='http://f.10086.cn/im/login/inputpasssubmit1.action'
- url_logout='http://f.10086.cn//im/index/logoutsubmit.action'
- url_msg='http://f.10086.cn/im/user/sendMsgToMyselfs.action'
- 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 '<card id="start".*?(ontimer="(.*?))' ${TempDir}/inputpasssubmit1.action | grep -Eo '(\/+[^\s]*)n'`
- arg_t=`grep -Eo '<card id="start".*?(ontimer="(.*?))' ${TempDir}/inputpasssubmit1.action | grep -Eo 't=\w+'`
- 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}
相关推荐
HelloC先生 2010-10-02
clliuhust 2011-08-03
yiranpiaoluo 2013-02-21
yuhuqiao 2010-08-20
heroxsx 2009-08-18
liuyaping 2010-05-10
chenlaoyang 2013-07-11
zhanglao 2009-06-27
布布地带 2011-02-25
86193952 2010-10-19
81427305 2009-06-14
lufybrooklin 2012-08-18
sheep 2012-08-06
89447715 2010-11-16
playlinuxxx 2010-09-22
chengkun 2010-09-13
drysilt 2009-10-23