Created
September 17, 2014 22:43
-
-
Save RobSpectre/b7e75f2aad28c51c7c45 to your computer and use it in GitHub Desktop.
Flask app to send a trust pound
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
# Import the Flask microframework we installed earlier. | |
from flask import Flask | |
# Import the Twilio Python module we install earlier. | |
from twilio import twiml | |
# Create our application | |
app = Flask(__name__) | |
# Create our webhook to respond to Twilio MMS with Adventure Time Gifs. | |
@app.route('/sms', methods=['POST']) | |
def sms(): | |
response = twiml.Response() | |
with response.message() as message: | |
message.body = "Trust pound!" | |
message.media("http://i.imgur.com/Act0Q.gif") | |
return str(response) | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment