John117 Posted August 3, 2007 Posted August 3, 2007 (edited) I am working to automate the field entries @http://messaging.sprintpcs.com/textmessaging/composewith preset entries in a script. I am missing the structure when a message is sentI would like something that I could make a string out of and send without visiting the website.here is an adaptation from another poster that I am working on. (cyberzerocool) -I think you should check out his posts, they rock!It does not have the correct breakdowns of where the data goes since I don't know the source settings.Can anyone point me in the right direction here . . .CODE#include <GUIConstants.au3>#include <HTTP.au3>Func smssend() $to = "CellphoneNumberHere" $From = "CellphoneNumberHere" $Msg = "Test Me Out" SplashTextOn( "SMS", "Sending message to: " & $to & " @ Sprint" &, 300, 200 ) $return = email( "SMS MSG", $to, $From, $Msg ) If $return = 0 Then SplashTextOn( "SMS", "MESSAGE FAILED", 300, 200 ) Else SplashTextOn( "SMS", "MESSAGE SENT", 300, 200 ) EndIf Sleep(2000) SplashOff()EndFuncFunc email( $from, $to, $msg, $html = 0 ) $soc = _HTTPConnect("www.messaging.sprintpcs.com") $data = "number=" & $to & "&username=" & $from & "&message=" & _HTTPEncodeString($msg) & "&Submit=Send" _HTTPPost("www.messaging.sprintpcs.com", "/textmessaging/compose", $soc, $data) If Not @error Then $return = 1 Else $return = 0 EndIf _HTTPClose($soc) Return $returnEndFuncedit: Gave shorter path to url Edited August 3, 2007 by Hatcheda
lod3n Posted August 3, 2007 Posted August 3, 2007 Check the source on that page: <input id="randomToken" name="randomToken" type="hidden" value="" /> Probably need to do something with that. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font]
John117 Posted August 3, 2007 Author Posted August 3, 2007 yeah, took a look at the source b4 posting. Seams a bit vague to me . . . was hoping someone might come up with the structure of the return when hit send . . .
NELyon Posted August 3, 2007 Posted August 3, 2007 (edited) I am trying something. If it will work, i will post it for you. #include <IE.au3> ; Sprint SMS Sender $oIE = _IECreate("http://messaging.sprintpcs.com/textmessaging/compose"); Creates IE window ;~ $oIE = _IECreate("http://messaging.sprintpcs.com/textmessaging/compose", 0, 0)crates hidden IE window $oForms = _IEFormGetObjByName($oIE, "composeForm"); Finds the "Form" to send the SMS $oNum1 = _IEFormElementGetObjByName($oForms, "phoneNumber"); Finds the "Phone Number" Field $intNumber = InputBox("Phone Number", "Input the phone number here", "5555555"); Asks for the phone number _IEFormElementSetValue($oNum1, $intNumber); Sets the phone number field $oMessage = _IEFormElementGetObjByName($oForms, "message"); Finds the "Message" field $sMessage = InputBox("Message", "Please input the message"); Asks for the message _IEFormElementSetValue($oMessage, $sMessage); Sets the Message field $oCallBack = _IEFormElementGetObjByName($oForms, "callBackNumber"); Finds the Callback Field $intCall = InputBox("Callback Number", "Input callback number here") _IEFormElementSetValue($oCallBack, $intCall) _IEFormSubmit($oForms) Edited August 3, 2007 by Senton-Bomb
John117 Posted August 3, 2007 Author Posted August 3, 2007 Dude, you ROCK! that works I will study it up as soon as I get home from work!
NELyon Posted August 3, 2007 Posted August 3, 2007 Dude, you ROCK! that works I will study it up as soon as I get home from work! No problem
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now