Skip to content

Instantly share code, notes, and snippets.

@RobSpectre
Created September 17, 2014 22:43
Show Gist options
  • Save RobSpectre/b7e75f2aad28c51c7c45 to your computer and use it in GitHub Desktop.
Save RobSpectre/b7e75f2aad28c51c7c45 to your computer and use it in GitHub Desktop.
Flask app to send a trust pound
# 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