Created
September 5, 2015 20:34
-
-
Save RobSpectre/9e79ffb877ed4c74318e to your computer and use it in GitHub Desktop.
Art museum example
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 | |
app = Flask(__main__) | |
@app.route('/sms', methods=['POST']) | |
def sms(): | |
response = twiml.Response | |
body = request.form['Body'] | |
if "#vangogh" in body: | |
response.message("I chopped off my ear.") | |
elif "#dali" in body: | |
response.message("I was really high.") | |
elif "#pollack" in body: | |
response.message("I was really messy.") | |
else: | |
response.message("Text #artist to learn more.") | |
if __name__ == "__main__": | |
app.debug = True | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment