Created
July 28, 2012 15:22
-
-
Save decause/3193730 to your computer and use it in GitHub Desktop.
Twilio Hello World that plays an mp3
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 render_template | |
import twilio.twiml | |
app = Flask(__name__) | |
@app.route("/") | |
def hello_world(): | |
"""Respond to incoming requests.""" | |
resp = twilio.twiml.Response() | |
resp.say('Hi There. This is a flask quickstart running on the Red Hat \ | |
Open Shift Cloud showing off a basic Twilio Hello World Example.') | |
resp.say('and now for some old-timey music...') | |
resp.play("http://groups.csail.mit.edu/mac/users/hal/misc/78s/collection/harry/harry.mp3") | |
return str(resp) | |
@app.route('/hello/<name>') | |
def hello(name=None): | |
return render_template('hello.html', name=name) | |
if __name__ == "__main__": | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment