[ILUG] sending sms via Blueface
Gerard Keating
gerard.keating at fintrax.com
Mon Oct 9 14:41:33 IST 2006
Is the cookie file required, cannot seem to find one on my machine.
Thanks
Gerard
-----Original Message-----
From: ilug-bounces at linux.ie [mailto:ilug-bounces at linux.ie] On Behalf Of
Gavin McCullagh
Sent: 08 October 2006 22:25
To: Irish Linux Users Group
Subject: [ILUG] sending sms via Blueface
Hi,
I'm a big fan of o2sms. Sadly, not everyone has that luxury,
particularly
if they don't have a Vodafone/O2/Meteor account). Also, some of them
apparently restrict who you can send to and they like to change their
site
regularly which can break o2sms for a bit.
If you have a blueface account, you can send text messages via their
website. They're not free, but the prices are fairly competitive
compared
to mobile phones and typing on a keyboard is a lot more convenient than
on
a mobile phone. However, their website is tedious with all that nasty
flash.
Below is a teeny, tiny script which will log you into their website and
send a text message from the command line. If you call the script bfsms
and put in your blueface username and password, you can do:
bfsms 0851234567 'Hi, how are you?'
You also need curl and libssl installed.
I'm not sure how reliable Blueface's website and SMS facility are, but
this
might be an option for automated sending of system notifications via
SMS.
It seems unlikely Blueface would want to thwart scripted use when they
get
money for it. One big downside is that the text message comes from
"blueface", so one can't reply to it, rendering it fairly useless for
conversations.
Still, might be handy some time,
Gavin
##############################################################
#!/bin/bash
USERNAME="myusername"
PASSWORD="mypassword"
NUMBER=$1
MESSAGE=$2
COOKIEFILE=bfcookies.txt
# login
curl -s -c $COOKIEFILE -d"username=$USERNAME&password=$PASSWORD"
https://www.blueface.ie/customers/login.aspx \
|grep "Account Code: " \
|sed 's/<[^>]*>//g' \
|sed 's/^\s*//'
# send sms
curl -s -b $COOKIEFILE
-d"destination=$NUMBER&message=$MESSAGE&sendaction=Send+SMS"
https://www.blueface.ie/customers/sms.aspx \
|grep "Message successfully sent to" \
|sed 's/<[^>]*>//g' \
|sed 's/^\s*//'
# logout.
rm $COOKIEFILE
##############################################################
--
Irish Linux Users' Group mailing list
About this list : http://mail.linux.ie/mailman/listinfo/ilug
Who we are : http://www.linux.ie/
Where we are : http://www.linux.ie/map/
More information about the ILUG
mailing list