Created
June 10, 2020 03:59
-
-
Save futureshocked/1810d1bec426d7a41994ee093a6b36b4 to your computer and use it in GitHub Desktop.
send_sms.py from Raspberry Pi Full Stack
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
| # Written by Billy Hare. | |
| # This script is part of the extension of the Raspberry Pi Full Stack project. | |
| # With this extension, your Raspberry Pu Full Stack application will be capable | |
| # of sending and receiving text messages via the Twilio service. | |
| # More information: https://techexplorations.com/so/rpifs/ | |
| import os | |
| from twilio.rest import Client | |
| account_sid = os.environ["TWILIO_ACCOUNT_SID"] | |
| auth_token = os.environ["TWILIO_AUTH_TOKEN"] | |
| my_twilio_phone_number = os.environ["TWILIO_PHONE_NUMBER"] | |
| receive_phone_number = os.environ["MY_PHONE_NUMBER"] | |
| test_text = "Hello from my Raspberry Pi!" | |
| client = Client(account_sid, auth_token) | |
| client.messages.create(to = receive_phone_number, | |
| from_ = my_twilio_phone_number, | |
| body = test_text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment