The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Text messaging from web url


  • To: <ukha_d@xxxxxxx>
  • Subject: Re: Text messaging from web url
  • From: "Alex Kinch" <alex@xxxxxxx>
  • Date: Wed, 2 Jul 2003 13:29:00 +0100
  • Mailing-list: list ukha_d@xxxxxxx; contact ukha_d-owner@xxxxxxx
  • Reply-to: ukha_d@xxxxxxx

Quick fix to that script, nothing serious - just pulled out a redundant bit
of scripting.

- Replaced 'hs.writelog "SMS Info", "Message reads: "
&
Replace(Message,"&"," ")' with 'hs.writelog
"SMS Info", "Message reads: " &
Message' as we no longer need to search for '&'s in the message body to
replace with a space.

Alex

'******************************************************************
'Script to send SMS messages using the sendmytxt.com service

'Call this function from your scripts or as a one-liner like this:
'hs.RunEx "sms.txt","SMS","RECIPIENT
NUMBER","TXTMESSAGE"
'e.g. hs.RunEx "sms.txt","sms","123456789,Hello
World"

Function sms(Params)

Dim MyMobileNum, PIN, Recipient, Message, host, page

SMSinfo = Split(Params,",")

Recipient = Trim(SMSinfo(0))
' Message = replace(SMSinfo(1)," ","&")
Message = SMSInfo(1)

PIN = "12345" 'Your sendmytxt.com PIN goes here
MyMobileNum = "1234567890" 'The mobile number you registered goes
here

host = "sendmytxt.com"
page = "/app/httpsend.asp?"
page = page & "from=" & MyMobileNum &
"&to=" & Recipient & "&pin=" & PIN
page = page & "&message=" & Message
strip_tags = false 'true
port = 80


Result = Trim(hs.GetURL(host, page, strip_tags, port))

Select Case Result

Case "0" ReturnVal = "No from number or pin entered"
Case "-1" Returnval = "from number not a registered
user"
Case "-2" ReturnVal = "incorrect pin"
Case "-3" ReturnVal = "account suspended"
Case "-4" ReturnVal = "insufficient credits"
Case "-5" ReturnVal = "message sending failed"
Case "-6" ReturnVal = "format of to number not
recognised"
Case "-7" ReturnVal = "format of from number not
recognised"
Case "ok" ReturnVal = "message sent successfully"

End Select

hs.writelog "SMS Info", "Sending message to: " &
Recipient
hs.writelog "SMS Info", "Message reads: " & Message
hs.writelog "SMS Info", "Service response: " &
ReturnVal
sms = ReturnVal
End Function

'***********************************************************************



Home | Main Index | Thread Index

Comments to the Webmaster are always welcomed, please use this contact form . Note that as this site is a mailing list archive, the Webmaster has no control over the contents of the messages. Comments about message content should be directed to the relevant mailing list.