Skip to content

Instantly share code, notes, and snippets.

@futureshocked
Created June 10, 2020 03:54
Show Gist options
  • Save futureshocked/c1a4449c17219dea4009a3e32ef18490 to your computer and use it in GitHub Desktop.
Save futureshocked/c1a4449c17219dea4009a3e32ef18490 to your computer and use it in GitHub Desktop.
receive_sms.py
# 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/
from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse
resp_text = "Thanks for the message!"
app = Flask(__name__)
@app.route("/sms", methods=['GET', 'POST'])
def sms_reply():
resp = MessagingResponse()
resp.message(resp_text)
return str(resp)
if __name__ == "__main__":
app.run(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment