Skip to content

Instantly share code, notes, and snippets.

@matmunn
Created March 7, 2017 01:20
Show Gist options
  • Save matmunn/be0fb42058a5980f9d2c5cb515fa4e5c to your computer and use it in GitHub Desktop.
Save matmunn/be0fb42058a5980f9d2c5cb515fa4e5c to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
import os
import plivo
import sys
from time import strftime
if not os.path.isdir(PATH):
sys.exit()
# returns 'None' if the key doesn't exist
PLIVO_AUTH_ID = os.environ.get('PLIVO_AUTH_ID')
PLIVO_AUTH_TOKEN = os.environ.get('PLIVO_AUTH_TOKEN')
# Phone numbers
my_number = '+xxxxxxxxxxx'
her_number = '+xxxxxxxxxxx'
p = plivo.RestAPI(PLIVO_AUTH_ID, PLIVO_AUTH_TOKEN)
params = {
'src': my_number,
'dst': her_number,
'text': u"Looks like I'm working late tonight."
}
response = p.send_message(params)
print "Message sent at " + strftime("%a, %d %b %Y %H:%M:%S")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment