Sin más el code y una imágen del mensaje recibido:
# m.24sms.net app to send sms
# Coded by Sanko
import urllib, urllib2
from cookielib import CookieJar
class SMS_Sender():
def __init__(self):
self._Responser()
def _Responser(self):
self.__Params('Sanko', 'Aqui tu prefijo + numero de telefono')
#
try:
data_encoded = urllib.urlencode(self.data)
response = self.opener.open("http://m.24sms.net/", data_encoded)
content = response.read()
except:
print "Error doing the response"
def __Parser():
if content == "Site is doing maintenance,please come back later.":
print "ERROR sending the SMS"
else:
print "the SMS was sent correctly!"
__Parser()
def __Params(self, author, number):
self.author = author
self.number = number
#capturing the cookies
try:
cj = CookieJar()
self.opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
except:
print "An error has ocurred capturing the cookies"
#params
self.data = {'al':1064, 'SendFrom':self.author, 'SendTo':self.number,
'Msg':'Probando sms app - Sanko', 'submit':'Send'}
SMS_Sender()
Imágen :
