The UK Home Automation Archive

Archive Home
Group Home
Search Archive


Advanced Search

The UKHA-ARCHIVE IS CEASING OPERATIONS 31 DEC 2024

Latest message you have seen: Re: OT ADVERT *grin* top gear tonight


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

Re: Re: Any SendMyTxt SMS scripts for non Homeseer users?



Here is a rough VB Script which should send a message using the
sendmytxt.com
service.
I'm not signed up to this service so I can't fully test it though.

The script will take 2 parameters if called from a 'run box', a shortcut or
another app (I think). These parameters are NUMBER & MESSAGE (in that
order).

If the parameters are missing, the script will prompt the user for the
relevant
information.

It is based on my first HS script, so will need the last bit changing.

Justin.


'*****************************
'Visual Basic script for the sendmytxt.com service
'Ver 1.0

Dim PIN, MyMobileNum, args, Host, Recipient, Message, Result, Returnval

PIN = "12345"			'Your sendmytxt PIN goes here
MyMobileNum = "123456789"	'The mobile number you registered goes
here

args = WScript.Arguments.Count  'See if we have been passed any parameters

If args > 1 then
Recipient = WScript.Arguments.Item(0)
Message = WScript.Arguments.Item(1)

Else

Recipient = InputBox ("Please enter the mobile number to send
to")
Message = InputBox ("Please enter your text message to send")

End IF


Host = "http://sendmytxt.com/app/httpsend.asp?from=";
& MyMobileNum _
& "&to=" & Recipient & "&pin="
& PIN& "&message=" & Message


set oHTTP = WScript.CreateObject("Microsoft.XMLHTTP")

oHTTP.open "GET", Host, False
oHTTP.send
Result = oHTTP.responseText
set oHTTP = nothing

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 Else ReturnVal = "Unknown error"

End Select

Msgbox ReturnVal
'******************************


Quoting kinchyuk <alex@xxxxxxx>:

>
> And then that URL got messed up! Here's a new one:
>
> http://www.sendmytxt.com/docs/httpget.pdf
>
> --- In ukha_d@xxxxxxx, "kinchyuk" <alex@a...> wrote:
> >
> > Apologies, Yahoo Groups has stripped the attachment from my
email.
> > You can download it from http://www.sendmytxt.com/docs/sendmytxt%
> > 20http%20get%20interface%20draft%201.pdf
> >
> > Alex
> >
> > --- In ukha_d@xxxxxxx, "Alex Kinch" <alex@a...>
wrote:
> > > Hi Steve,
> > >
> > > It shouldn't be too difficult to write a script for ACE, or
for
> > most other
> > > applications that support HTTP GET requests and can parse
the
> > response.
> > >
> > > Here's a draft of the documentation for the interface, any
> comments
> > from the
> > > group would be appreciated!
> > >
> > > Cheers,
> > > Alex
> > >
> > >
> > > ----- Original Message -----
> > > Message: 11
> > >    Date: Mon, 7 Jul 2003 12:28:46 +0100
> > >    From: steve.cooper@u...
> > > Subject: Any SendMyTxt SMS scripts for non Homeseer users?
> > >
> > >
> > > >> Here's an updated Homeseer script, which will allow
you to
> send
> > text
> > > >> messages through the SendMyTxt http->sms
gateway.
> > >
> > > Has anyone had a go and doing a version for ACE yet? Or some
> > windows type
> > > app for none Homeseer users?


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.