Dhiraagu + Maemo = One cool balance widget

This is a little script to echo Balance, expiry and free SMS + expiry. It uses ussd4all and i have so far been unable to get the dialogue to not show.

In addition, it also logs the queries in a neat form in /home/user/MyDocs/Dt/balance.log

Balance Log

The output can also be passed to the desktop command execution widget and displayed on desktop.. The echo has a slightly different format from the log:

Script:


bal=`/usr/bin/ussdquery.py *142#`
fir=`echo $bal | cut -d \; -f 1`
RF=`echo $fir | cut -d \  -f 3`
echo Balance\: $RF
echo ===\ `date` === >> /home/user/MyDocs/Dt/balance.log
RFEX=`echo $fir | cut -d \  -f 6`
echo Bal.Exp\: $RFEX
SMS=`echo $bal | cut -d \  -f 8`
echo F.SMS\: $SMS
SMSEX=`echo $bal | cut -d \  -f 13`
echo SMS.Exp:\ $SMSEX
echo Balance:\ $RF \($RFEX\) SMS:\ $SMS \($SMSEX\)>> /home/user/MyDocs/Dt/balance.log

End Note: This little plain script is known to misbehave… anyone feel free to add/cut/modify/append/throw/ this script in any way you like.. though it would be nice if you can drop a copy of noteworthy improvements over here..
Advertisements

About unhackmee

typical teenager rumbling about everything not worth your time... Mostly about things that would waste precious seconds from your life, stolen- and never to be returned. WARNING: Discontinue use and seek immediate medical attention should rashes or itchiness occur.

Posted on November 4, 2010, in N900 and tagged , , . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: