Last active
January 4, 2016 02:09
-
-
Save dmnobunaga/8552925 to your computer and use it in GitHub Desktop.
Example of usage ByteHand.com service
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# License CC BY | |
__author__ = '[email protected]' | |
import requests | |
url = "http://bytehand.com:3800/send" | |
bytehandId = 0000 | |
bytehandKey = "XXXXXXXXXXXXXXXX" | |
bytehandFrom = "SMS-Info" | |
def sendSMS(bytehandto, bytehandtext): | |
global url | |
global bytehandId | |
global bytehandKey | |
global bytehandFrom | |
data = { | |
"id": bytehandId, | |
"key": bytehandKey, | |
"from": bytehandFrom, | |
"to": bytehandto, | |
"text": bytehandtext | |
} | |
r = requests.get(url=url, params=data) | |
if r.status_code == 200: | |
return True | |
else: | |
#print r.text # Uncomment for debug purposes | |
return False | |
#Example usage | |
print sendSMS("79161234567", "Test"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment