import hashlib import urllib import md5 import sys from urllib import urlencode # Identification nichandle = 'SO3020-SA' password = 'XXXXXXX' # Message number = '32475151230' senderid = '32475151230' content = 'bonjour tout le monde! héhé' # Extra params hash = 'md5' sendertype = 'text' typecontent = 'text' udh = '' passphrase = hashlib.md5(password + number).hexdigest() nichandle = urlencode({'nichandle':nichandle}) password = urlencode({'password':password}) hash = urlencode({'hash':hash}) passphrase = urlencode({'passphrase':passphrase}) number = urlencode({'number':number}) senderid = urlencode({'senderid':senderid}) content = urlencode({'content':content}) sendertype = urlencode({'sendertype':sendertype}) typecontent = urlencode({'typecontent':typecontent}) udh = urlencode({'udh':udh}) url = "http://api.smsaction.be:80/get_push/" url += "?"+nichandle+"&"+hash+"&"+ passphrase +"&"+ number url += "&"+typecontent+"&"+content+"&"+sendertype url += "&"+senderid+"&" + udh f = urllib.urlopen(url) s = f.read() print s f.close()