Skip to content

Instantly share code, notes, and snippets.

@decause
Created July 28, 2012 15:22
Show Gist options
  • Save decause/3193730 to your computer and use it in GitHub Desktop.
Save decause/3193730 to your computer and use it in GitHub Desktop.
Twilio Hello World that plays an mp3
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