Created
February 16, 2014 12:29
-
-
Save RobSpectre/9033516 to your computer and use it in GitHub Desktop.
Example of receiving an SMS.
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
from flask import Flask | |
from flask import request | |
from twilio import twiml | |
# Declare and configure application | |
app = Flask(__name__) | |
@app.route('/sms', methods=['POST']) | |
def sms(): | |
body = request.form['Body'] | |
from_number = request.form['From'] | |
# Where you put the Facebook code.... | |
# End Facebook code. | |
response = twiml.Response() | |
response.message('Your comment was saved.') | |
return str(response) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment