maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Easy way to prompt for string/numbers (https://talk.maemo.org/showthread.php?t=18109)

brontide 2008-03-20 02:48

Easy way to prompt for string/numbers
 
I've got a custom script ./call.sh that will wget the appropriate GrandCentral page and initiate a call back outgoing call. Right now I just accept the number on the command line, but I would love to know how to make it prompt and collect a number from the user.

I'm not now to linux or development, but with maemo I'm kinda lost.

Munk 2008-03-20 05:32

Re: Easy way to prompt for string/numbers
 
I can't help with a gui front end but would love a copy of the script.

brontide 2008-03-20 13:13

Re: Easy way to prompt for string/numbers
 
It's stupid simple since it's just a matter of setting up the right calling enviornment for wget.

./call.sh 8005551212
./call.sh 800 druidia

Should result in getting a call on your gizmo line ( assuming you have the whole GC + gizmo thingee setup ). I presume you have already logged in to m.grandcentral.com and set your NIT as your "mobile" phone. Looking at the cookies it's possible to do more with this ( like ring any phone with any number ) with some simple tweaking.


Code:

#!/bin/sh

# Atempts to translate the command line into numbers without spaces or other chras                                                                             
number=`echo $* | sed 'y|abcABCdefDEFghiGHIjklJKLmnoMNOpqrsPQRStuvTUVwxyzWXYZ|2222223333334444445555556666667777777788888899999999|; s|[^0123456789\\\#\\\*]||g'`
                                                                                                                                                                                                         
echo wget -O /dev/null -q --load-cookie=/home/user/.mozilla/microb/cookies.txt --referer=http://www.grandcentral.com/mobile/messages http://www.grandcentral.com/mobile/calls/click_to_call?destno=$number



All times are GMT. The time now is 11:49.

vBulletin® Version 3.8.8