Created
September 13, 2012 09:37
-
-
Save nskeip/3713222 to your computer and use it in GitHub Desktop.
smsintel.ru django snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf import settings | |
def send_sms(phone, text): | |
q = ("<?xml version='1.0' encoding='UTF-8'?><data><login>%(login)s</login>" + | |
"<password>%(password)s</password><text>%(text)s</text><to number='%(phone)s'></to></data>") % { | |
'phone': phone.encode('utf-8'), | |
'text': text.encode('utf-8'), | |
'login': settings.SMS_INTELL_LOGIN, | |
'password': settings.SMS_INTELL_PASSWORD, | |
} | |
urllib2.urlopen('https://transport.smsintel.ru:7214/send.xml', q) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment