View Single Post
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#27
hey all!

maybe this is helpful for some of you guys:
i wanted to ssh from my laptop into my n900 to send sms from cli.
smssend was exactly what i needed...
...except that i only have the numbers of my contacts on my n900.
these numbers are stored in a nasty database and not easily accessible.
so i needed a way to get those numbers.
fortunately there are some smart programers at this forum:
http://talk.maemo.org/showthread.php...608#post990608
big thanks to nicolai once again!

with his python script i was able to write an own little script which makes smssend more comfortable to use:
PHP Code:
number=$(python /usr/bin/nicolais_script -$-grep -A 3 -B 3 NICKNAME:$grep CELL cut -d: -f2 sed '$s/.$//')
smssend -n $number -"$2"
echo "SMS to $1 ($number): \"$2\""
exit 
usage: mysmssend nickname "text of sms"

it searches the database for the nickname, extracts the (first) cellphone number and sends the text via smssend to the contact.
and it produces a control output afterwards.

i.e.:
mysmssend Chris "hi chris!"
output:
SMS to Chris (+49123456789): "hi chris!"

but there is a problem if two contacts start with the same nickname string like "Chris" and "Christina".
this could be solved by advanced programing of nicolai's python or my script.

i think nicolai's script will help some of you - that was the main reason for this post.

edit:
i forgot to mention that i forward all received sms to an email-acc with another of nicolai's great apps:
http://talk.maemo.org/showthread.php?t=69264

i fetch/sync the emails from this acc every minute via imap in thunderbird.
so i'm always informed about the sms on my phone even it isn't in my pocket.
(and because my phone is always connected to my home-wlan i can ssh into it and answer the sms without searching/grabbing my phone xD)

Last edited by b666m; 2011-04-17 at 20:40.
 

The Following 4 Users Say Thank You to b666m For This Useful Post: