Last active
December 19, 2015 19:18
-
-
Save codeboy/6004848 to your computer and use it in GitHub Desktop.
send sms via smsaero.ru
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
### | |
# Sending sms via smsaero.ru gate | |
### | |
import requests | |
import time | |
import hashlib | |
def sms_sender( | |
number='79825552211', | |
message='some mesage', | |
user='some_user' | |
raw_password='some password'): | |
url = 'http://gate.smsaero.ru/send/' | |
m = hashlib.md5() | |
m.update(raw_password) | |
password = m.hexdigest() | |
params_dict = dict({ | |
'to':number, | |
'text': message, | |
'user' : user, | |
'password' : password, | |
'from' : 'from_name', | |
# 'date' : time.time() | |
}) | |
r = requests.post(url, data=params_dict) | |
print 'code: %s | status: %s' % (r.status_code, r.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment