Skip to content

Commit

Permalink
Added template.
Browse files Browse the repository at this point in the history
Added music/lyrics.
Added requirements / procfile
Draft of app.
  • Loading branch information
RobSpectre committed Jan 13, 2012
0 parents commit 2455fb2
Show file tree
Hide file tree
Showing 7 changed files with 87 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
@@ -0,0 +1,9 @@
bin
build
include
lib
.Python
*.pyc
*.project
*.pydevproject
*.pyo
1 change: 1 addition & 0 deletions Procfile
@@ -0,0 +1 @@
web: python app.py
15 changes: 15 additions & 0 deletions app.py
@@ -0,0 +1,15 @@
import flask
from twilio import twiml
import os

app = flask.Flask(__name__)

@app.route('/karaoke')
def karaoke():
response = twiml.Response()
with response.dial() as dial:
dial.conference("Penn Apps Karaoke Party")
return str(response)

if __name__ == "__main__":
app.run('0.0.0.0', 5000)
Binary file added music/ramones.mp3
Binary file not shown.
8 changes: 8 additions & 0 deletions music/ramones.txt
@@ -0,0 +1,8 @@
Hey ho, let's go
Hey ho, let's go
Hey ho, let's go
Hey ho, let's go
They're forming in straight line
They're going through a tight wind
The kids are losing their minds
The Blitzkrieg Bop
2 changes: 2 additions & 0 deletions requirements.txt
@@ -0,0 +1,2 @@
Flask==0.7.2
Twilio==3.3.2
52 changes: 52 additions & 0 deletions templates/client.html
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<html>
<head>
<title>Twilio Karaoke</title>
<script type="text/javascript"
src="http://static.twilio.com/libs/twiliojs/1.0/twilio.min.js"></script>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js">
</script>
<link href="http://static0.twilio.com/packages/quickstart/client.css"
type="text/css" rel="stylesheet" />
<script type="text/javascript">

Twilio.Device.setup("{{token}}");

Twilio.Device.ready(function (device) {
$("#log").text("Ready");
});

Twilio.Device.error(function (error) {
$("#log").text("Error: " + error.message);
});

Twilio.Device.connect(function (conn) {
$("#log").text("Successfully established call");
});

Twilio.Device.disconnect(function (conn) {
$("#log").text("Call ended");
});

function call() {
Twilio.Device.connect();
}

function hangup() {
Twilio.Device.disconnectAll();
}
</script>
</head>
<body>
<button class="call" onclick="call();">
Call
</button>

<button class="hangup" onclick="hangup();">
Hangup
</button>

<div id="log">Loading pigeons...</div>
</body>
</html>

0 comments on commit 2455fb2

Please sign in to comment.