Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jun 2005

    simple script with prompts

    hi there, i have script with some variables and i have no python knowledge can some one edit following script so when i run it will ask originator , recipient , text and post it to host? everything is there but i couldnt make it asking those 3 variables values

    Thank you

    print 'Content-Type: text/html'
    print # Blank line marking end of HTTP headers
    import socket
    HOST = 'xml1.aspsms.com' # The remote host
    PORT = 5061 # The same port as used by the server
    userkey = #please fill in your USERKEY
    password = #please enter your PASSWORD
    originator = #please fill in the ORIGINATOR
    recipient = #please insert the RECIPIENT here
    text = #Your SMS Text
    CONTENT="""<?xml version="1.0" encoding="ISO-8859-1"?>
    <Originator>"""+ str(originator) +"""</Originator>
    <PhoneNumber>"""+ str(recipient) +"""</PhoneNumber>
    <MessageData>"""+ str(text) +"""</MessageData>
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
    s.send("POST /xmlsvr.asp HTTP/1.0\r\n")
    s.send("Content-Type: text/xml\r\n")
    s.send("Content-Length: "+str(length)+"\r\n\r\n")
    print "Reply Received: "+ str(datarecv)

  2. #2
    Registered User
    Join Date
    Apr 2004
    Hi look at the appuifw.query()

    HOST = appuifw.query(u"Hostname","text","xml1.aspsms.com")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts