Send SMS to Cingular users via Terminal

Sep 18, '06 07:30:06AM

Contributed by: Anonymous

This is my first hint, and it is really a trivial idea I had. I thought it would be neat to send a text message from Terminal using curl. So here it goes:

curl -d "from=$1&min=$2&msg=$3" \
http://www.cingularme.com/do/public/send
This is all on one line, of course (but with the backslash, copy and paste should work). Name the file curlsms, change the permission to allow execution (chmod a+x curlsms), and place it in a folder of your liking. To run it, navigate to its directory and the usage is:
./curlsms sender 1234567890 Message text
Replace sender with your name, 1234567890 with the recipient's phone number, and Message text with the message you'd like to send. I'm sure some of you super-creative users could integrate this into AppleScripts and do some really neat Mail rules and all that business with such a script.

Keep in mind there is a character limit on many of the text fields of Cingular's web form. This script does not make the necessary checks, and those additions would be pretty nice. Also, you can check out the form and add scheduling features and priority features as well. I am a bash shell idiot, and it would take me years to make this robust.

[robg adds: This worked; the only change I made was to add > /dev/null to the end, after the URL. I did this to route the output of the curl command into never-never land -- otherwise you'll see the URL's source code go scrolling past. With the change, you'll only see a summary of the transmission time at the end.]

Comments (18)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20060913202617195