Skip to content

Instantly share code, notes, and snippets.

@woutervdijke
Created March 28, 2017 19:53
Show Gist options
  • Save woutervdijke/33e5675f50f65ae0d490009c96e8ba0d to your computer and use it in GitHub Desktop.
Save woutervdijke/33e5675f50f65ae0d490009c96e8ba0d to your computer and use it in GitHub Desktop.
Python module to text myself
#! python3
# textMe.py - Defines the wouter() function that texts me a message
# passed to it as a string.
# based on 'Automate the boring stuff with Python' by Al Sweigart
# when installed in the site-packages folder where Python is installed, it
# can be called using "import textme"
# Preset values:
accountSID = 'TWILIOSID'
authToken = 'TWILIOTOKEN'
wouterNumber = 'MyOwnNumber'
twilioNumber = 'MyTwilioNumber'
from twilio.rest import TwilioRestClient
def wouter(message):
twilioCli = TwilioRestClient(accountSID, authToken)
twilioCli.messages.create(body=message, from_=twilioNumber, to=wouterNumber)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment