| version 1.2, 2002/06/11 17:03:31 |
version 1.3, 2002/06/12 12:53:47 |
| Line 16 if [ $# -lt 1 ]; then |
|
| Line 16 if [ $# -lt 1 ]; then |
|
| exit 1; |
exit 1; |
| fi |
fi |
| |
|
| NAME='wolcano' |
NAME='Platon' |
| PASS='ossetepo' |
PASS='45F4BBE1' |
| |
|
| echo ' Enter your message (only one line, max 420 chars):' |
echo ' Enter your message (only one line, max 420 chars):' |
| IF= read text |
IF= read text |
| |
|
| # download the file via special wget which stores session cookie to a file |
# download the file via special wget which stores session cookie to a file |
| ./wget-special \ |
wget-special \ |
| -q \ |
-q \ |
| --delete-after \ |
--delete-after \ |
| --save-cookies cookies.tmp.txt \ |
--save-cookies cookies.tmp.txt \ |
| --header="Cookie: SITY=SITY" \ |
--header="Cookie: SITY=SITY" \ |
| http://www.sity.sk/pls/sity/u_registrate2.login2?NAME="$NAME"\&PASSWD="$PASS"\&ASERVICE=0\&CMD=%21u_sms.home\&SERVICE=0 |
http://www.sity.sk/pls/sity/u_registrate2.login2?NAME="$NAME"\&PASSWD="$PASS"\&ASERVICE=0\&CMD=%21u_sms.home\&SERVICE=0 |
| |
|
| ./wget-special \ |
wget-special \ |
| --output-document=tmp.html \ |
--output-document=tmp.html \ |
| |
-q \ |
| --load-cookies cookies.tmp.txt \ |
--load-cookies cookies.tmp.txt \ |
| --save-cookies cookies.tmp.txt \ |
--save-cookies cookies.tmp.txt \ |
| http://www.sity.sk/pls/sity/\!u_sms.home |
http://www.sity.sk/pls/sity/\!u_sms.home |
| |
|
| #we now extract textarea name, which will be used later |
#we now extract textarea name, which will be used later |
| textareaname=`grep 'textarea cols' tmp.html | sed 's/.*name="\([^"]*\)".*/\1/g'` |
textareaname=`grep 'textarea cols' tmp.html | sed 's/.*name="\([^"]*\)".*/\1/g'` |
| |
detailvalue=`grep 'DETAIL' tmp.html | sed 's/.*value="\([^"]*\)".*/\1/g'` |
| |
|
| |
echo 'Hold still, we need to wait 4 seconds.' |
| |
sleep 4 |
| |
|
| # everything is OK, just we should POST and not GET (now it returns error page) |
# everything is OK, just we should POST and not GET (now it returns error page) |
| ./wget-special --output-document=tmp2.html \ |
wget-special --output-document=tmp2.html \ |
| |
-q \ |
| --load-cookies cookies.tmp.txt \ |
--load-cookies cookies.tmp.txt \ |
| http://www.sity.sk/pls/sity/\!u_sms.send_sms?MSG_TEXT="$text"\&SMSMsgLen=480\&SMScount="$textareaname"="$1"\&BT.x=0\&BT.y=0\&DETAIL= |
--header="Pragma: no-cache" \ |
| |
--header="Cache-Control: no-cache" \ |
| |
--header="Cookie2: \$Version="1"" \ |
| |
--header="Content-type: application/x-www-form-urlencoded" \ |
| |
--user-agent="Lynx/2.8.4rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/0.9.6c" \ |
| |
http://www.sity.sk/pls/sity/\!u_sms.send_sms?MSG_TEXT="$text"\&SMSMsgLen=480\&SMScount=\&"$textareaname"="$1"\&BT.x=0\&BT.y=0\&DETAIL="$detailvalue" |
| |
|
| |
smss_left=`grep "Tento mesiac" tmp2.html | sed 's/.*va \([0-9]*\) spr.*/\1/'` |
| |
|
| |
echo "Message sent. $smss_left SMSs left for this month." |
| |
|
| # delete unnecessary files, now leaving for debug.. |
# delete unnecessary files, now leaving for debug.. |
| rm tmp.html |
rm tmp.html |
| #rm tmp2.html |
rm tmp2.html |
| rm cookies.tmp.txt |
rm cookies.tmp.txt |