| version 1.28, 2002/07/02 00:55:04 |
version 1.29, 2002/07/04 14:29:28 |
|
|
| |
|
| umask 077 |
umask 077 |
| |
|
| |
GET="/usr/bin/GET" |
| |
|
| CONFIG_FILE="$HOME/.sms.sh.conf"; |
CONFIG_FILE="$HOME/.sms.sh.conf"; |
| ALIAS_FILE="$HOME/.sms.sh.alias"; |
ALIAS_FILE="$HOME/.sms.sh.alias"; |
| |
|
|
|
| # Cookies format: |
# Cookies format: |
| # ^Set-Cookie: SITY=32E0DDB9AF9293E774AA1C0B5BCC0992;path=/$ |
# ^Set-Cookie: SITY=32E0DDB9AF9293E774AA1C0B5BCC0992;path=/$ |
| echo 'Logging in...'; |
echo 'Logging in...'; |
| COOKIE=`GET -P -e -H "Cookie: SITY=SITY" \ |
COOKIE=`$GET -P -e -H "Cookie: SITY=SITY" \ |
| $WWW/u_registrate2.login2?NAME="$NAME"\&PASSWD="$PASS"\&ASERVICE=0\&CMD=%21u_sms.home\&SERVICE=0 \ |
$WWW/u_registrate2.login2?NAME="$NAME"\&PASSWD="$PASS"\&ASERVICE=0\&CMD=%21u_sms.home\&SERVICE=0 \ |
| | awk 'BEGIN { FS="[=;]" } /^Set-Cookie:/ { print $2; }'`; |
| awk 'BEGIN { FS="[=;]" } /^Set-Cookie:/ { print $2; }'`; |
| # | grep '^Set-Cookie' | sed 's/^Set-Cookie: SITY=\([0-9A-F]*\).*/\1/'`; |
# | grep '^Set-Cookie' | sed 's/^Set-Cookie: SITY=\([0-9A-F]*\).*/\1/'`; |
| Line 145 COOKIE=`GET -P -e -H "Cookie: SITY=SITY" |
|
| Line 147 COOKIE=`GET -P -e -H "Cookie: SITY=SITY" |
|
| |
|
| # Checking number of free SMSs {{{ |
# Checking number of free SMSs {{{ |
| echo -n 'Checking number of free SMSs... '; |
echo -n 'Checking number of free SMSs... '; |
| #GET -P -H "Cookie: SITY=$COOKIE" \ |
#$GET -P -H "Cookie: SITY=$COOKIE" \ |
| # $WWW/u_profil.show_stat > $TMP_FILE; |
# $WWW/u_profil.show_stat > $TMP_FILE; |
| #smss_sent=`grep '^<TD>[0-9]\+</TD>$' $TMP_FILE \ |
#smss_sent=`grep '^<TD>[0-9]\+</TD>$' $TMP_FILE \ |
| # | head -n 1 | sed 's/<TD>\([0-9]\+\).*/\1/'`; |
# | head -n 1 | sed 's/<TD>\([0-9]\+\).*/\1/'`; |
| smss_sent=`GET -P -H "Cookie: SITY=$COOKIE" \ |
smss_sent=`$GET -P -H "Cookie: SITY=$COOKIE" \ |
| $WWW/u_profil.show_stat \ |
$WWW/u_profil.show_stat \ |
| | awk '/^<TD>[0-9]+<\/TD>$/ { gsub(/[><]/, " "); print $2; exit; } '`; |
| awk '/^<TD>[0-9]+<\/TD>$/ { gsub(/[><]/, " "); print $2; exit; } '`; |
| |
|
| Line 158 echo "100-$smss_sent" | bc; |
|
| Line 160 echo "100-$smss_sent" | bc; |
|
| |
|
| # Retrieving submit forms... {{{ |
# Retrieving submit forms... {{{ |
| echo 'Retrieving submit forms...'; |
echo 'Retrieving submit forms...'; |
| GET -P -H "Cookie: SITY=$COOKIE" \ |
$GET -P -H "Cookie: SITY=$COOKIE" \ |
| $WWW/\!u_sms.home >$TMP_FILE; |
$WWW/\!u_sms.home >$TMP_FILE; |
| |
|
| #we now extract textarea name, which will be used later |
#we now extract textarea name, which will be used later |
|
|
| |
|
| # Submitting SMS... {{{ |
# Submitting SMS... {{{ |
| echo 'Submitting SMS...'; |
echo 'Submitting SMS...'; |
| smss_left=`GET -P -H "Cookie: SITY=$COOKIE" \ |
smss_left=`$GET -P -H "Cookie: SITY=$COOKIE" \ |
| $WWW/\!u_sms.send_sms?MSG_TEXT="$text"\&SMSMsgLen=480\&SMScount=\&"$textareaname"="$number"\&BT.x=0\&BT.y=0\&DETAIL="$detailvalue" \ |
$WWW/\!u_sms.send_sms?MSG_TEXT="$text"\&SMSMsgLen=480\&SMScount=\&"$textareaname"="$number"\&BT.x=0\&BT.y=0\&DETAIL="$detailvalue" \ |
| | grep "Tento mesiac" \ |
| grep "Tento mesiac" \ |
| | sed 's/.*va \([0-9]*\) spr.*/\1/'` ; |
| sed 's/.*va \([0-9]*\) spr.*/\1/'` ; |