Skip to content

Commit

Permalink
polishing it up
Browse files Browse the repository at this point in the history
  • Loading branch information
Carter Rabasa committed Sep 18, 2012
1 parent 2c3f2a6 commit 4823341
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
4 changes: 2 additions & 2 deletions events.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var config = require('./config')
}
}
});
}
}

// check to see if this user has voted for this event

Expand Down Expand Up @@ -63,7 +63,7 @@ var config = require('./config')
callback(msg, null);
}
else {
callback(null, res);
callback(null, event.voteoptions[index]);
}

});
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
{
"name": "votr-part-1",
"version": "0.0.1",
"version": "0.0.2",
"private": true,
"scripts": {
"start": "node app"
"start": "app.js"
},
"dependencies": {
"express": "3.0.0rc3",
"hjs": "*",
"cradle": "0.6.3",
"twiliosig": "0.0.1"
},
"subdomain": "votr-part1",
"engines": {
"node": "0.6.x"
}
}
5 changes: 3 additions & 2 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exports.index = function(req, res){
*/

exports.voteSMS = function(request, response) {
if (twiliosig.valid(request, config.twilio.key) || true) {
if (twiliosig.valid(request, config.twilio.key) || config.disableTwilioSigCheck) {
response.header('Content-Type', 'text/xml');
var body = request.param('Body').trim();

Expand Down Expand Up @@ -56,7 +56,8 @@ exports.voteSMS = function(request, response) {
response.send('<Response><Sms>We encountered an error saving your vote. Try again?</Sms></Response>');
}
else {
response.send('<Response><Sms>Thanks for your vote for ' + event.name + '. Powered by Twilio.</Sms></Response>');
console.log('Accepting vote: ' + event.name + ', ' + from);
response.send('<Response><Sms>Thanks for your vote for ' + res.name + '. Powered by Twilio.</Sms></Response>');
}
});
}
Expand Down
10 changes: 10 additions & 0 deletions views/forbidden.hjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>Forbidden</title>
<link rel="shortcut icon" href="/img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"></head>
<body>
<iframe width="560" height="315" src="http://www.youtube.com/embed/RfiQYRn7fBg" frameborder="0" allowfullscreen></iframe>
</body>
</html>

0 comments on commit 4823341

Please sign in to comment.