Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 0713d256dd09c3a76a84bf0f32e8700e17486913 @chrismatthieu committed Dec 10, 2010
2 .gems
@@ -0,0 +1,2 @@
+sinatra
+rest_client
2 config.ru
@@ -0,0 +1,2 @@
+require 'santa'
+run Sinatra::Application
BIN public/background.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN public/input-bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN public/phone.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 public/style.css
@@ -0,0 +1,30 @@
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td { margin: 0; padding: 0; }
+fieldset,img { border: 0; }
+input,button,textarea,select,optgroup,option { font-family: inherit; font-size: inherit; font-style: inherit; font-weight: inherit; }
+input,button,textarea,select { *font-size: 100%; }
+
+html { background: url(/background.jpg) no-repeat 0 -54px; background-color: #004;}
+body { font-family: Helvetica, Arial, sans-serif; color: #ffffff; }
+
+form #input-wrap { padding: 400px 400px 20px 404px; }
+form em { font-size: 2em; font-weight: 900; display: inline;margin-left: -5px; }
+form input { background: rgba(255,255,255,0.3) no-repeat 0 -54px; border: 0; padding: 8px 10px; font-size: 20px; font-weight: bold; letter-spacing: 0.1em; -webkit-border-radius: 10px; -moz-border-radius: 10px; border-radius: 10px; color: #ffffff; }
+form input#countryCode { width: 75px; background-position: -116px -54px; text-align: center; margin: 10px auto; padding: 8px 5px;}
+#country-field { width: 200px; margin: 0 auto; font-size: 0.8em; text-align: center; margin: 23px auto 10px; padding: 10px; background: rgba(255,255,255,.5); }
+#country-field em { margin-right: 5px; color: #eee; font-style: normal; }
+#country-field label{ display: block; }
+a#not-us { font-size: 0.8em; font-weight: normal; margin: 0 auto; width: 86px; display: block; margin-top: -90px;}
+form input#areacode { width: 65px; padding: 5px 10px 8px; }
+form input#firstthree { width:65px; background-position: -116px -54px; }
+form input#lastfour { width: 89px; background-position: -213px -54px; }
+form input#submit { width: 100px; margin: 10px auto; display: block; }
+form label.error { font-size: 10px; color: #666; font-weight: 100; margin-top: 5px; line-height:1.4em; width: 82px; height: 50px; display: block; }
+form #input-wrap fieldset { display: inline; margin: 0 6px; height: 50px; }
+
+p { text-align: center; font-size: 10px; margin: 10px 0; clear: both;}
+a { color: #999; font-weight: 900; }
+#tropo-donate { clear: both; padding-top: 15px; width: 355px; margin: 0 auto; }
+#tropo { width: 350px; float: left; color: #000; margin-top: 150px;}
+#tropo-logo { margin: 0 auto; width: 150px; display: block; margin-top: -10px; }
+
+#call-wrap { padding: 550px 400px 20px 504px; }
BIN public/tropo-logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 santa.rb
@@ -0,0 +1,56 @@
+require "rubygems"
+require "sinatra"
+require "rest_client"
+
+get "/" do
+ html = '<html><head><link type="text/css" rel="stylesheet" href="/style.css" media="screen" /></head>'
+ html << '<body>'
+ html << '<form id="call" method="post" action="/">
+ <div id="input-wrap"> <center><h1>Santa Calling</h1></center><br/>
+ <em>(</em>
+ <fieldset>
+ <input type="text" id="areacode" name="areacode" class="text" maxlength="3" tabindex="1" />
+ </fieldset>
+ <em>)</em>
+ <fieldset>
+ <input type="text" id="firstthree" name="num1" class="text" maxlength="3" tabindex="2" />
+ </fieldset>
+ <em>-</em>
+ <fieldset>
+ <input type="text" id="lastfour" name="num2" class="text" maxlength="4" tabindex="3" />
+ </fieldset>
+ <fieldset>
+ <input type="text" id="recipient" name="recipient" class="text" value="Recipient\'s Name" tabindex="4" />
+ </fieldset>
+ </div>
+ <fieldset>
+ <input type="submit" value="Call" id="submit" tabindex="5" />
+ </fieldset>
+ </form>
+
+ <div id="tropo-donate" class="clearfix">
+ <div id="tropo">
+ <p>Voice API provided by <a href="http://tropo.com/">Tropo</a></p>
+ <a href="http://tropo.com/"><img src="/tropo-logo.png" id="tropo-logo" alt="Tropo Logo" /></a>
+ <br/><br/></div>
+ </div></body></html>'
+ return html
+end
+
+post "/" do
+
+ RestClient.get 'http://api.tropo.com/1.0/sessions?action=create&token=0a061c943b623546886b62f124d0f329a71beea4135c0e8f0b55bc61e33ffa211ce1301a15a58c37781f5715&number=1' + params[:areacode] + params[:num1] + params[:num2] + '&name=' + params[:recipient]
+
+ html = '<html><head><link type="text/css" rel="stylesheet" href="/style.css" media="screen" /></head>'
+ html << '<body>'
+ html << '<div id="call-wrap">Calling...</div>
+
+ <div id="tropo-donate" class="clearfix">
+ <div id="tropo">
+ <p>Voice API provided by <a href="http://tropo.com/">Tropo</a></p>
+ <a href="http://tropo.com/"><img src="/tropo-logo.png" id="tropo-logo" alt="Tropo Logo" /></a>
+ <br/><br/></div>
+ </div></body></html>'
+ return html
+
+end

0 comments on commit 0713d25

Please sign in to comment.