diff --git a/Gemfile b/Gemfile index cd06c1d..a119e29 100644 --- a/Gemfile +++ b/Gemfile @@ -1,35 +1,12 @@ source 'http://rubygems.org' gem 'rails', '3.0.9' -gem "aws-s3", :require => "aws/s3" gem "rest-client" gem "rake", "0.8.7" -gem "flickraw" - -# Bundle edge Rails instead: -# gem 'rails', :git => 'git://github.com/rails/rails.git' - gem 'mysql2', '~> 0.2.6' -# Use unicorn as the web server -# gem 'unicorn' - -# Deploy with Capistrano -# gem 'capistrano' - -# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+) -# gem 'ruby-debug' -# gem 'ruby-debug19', :require => 'ruby-debug' +# used for heroku and web app +# gem "aws-s3", :require => "aws/s3" +# gem "flickraw" -# Bundle the extra gems: -# gem 'bj' -# gem 'nokogiri' -# gem 'sqlite3-ruby', :require => 'sqlite3' -# gem 'aws-s3', :require => 'aws/s3' -# Bundle gems for the local environment. Make sure to -# put test-only gems in this group so their generators -# and rake tasks are available in development mode: -# group :development, :test do -# gem 'webrat' -# end diff --git a/Gemfile.lock b/Gemfile.lock index 71f18a0..1d487cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -29,25 +29,18 @@ GEM activesupport (= 3.0.9) activesupport (3.0.9) arel (2.0.10) - aws-s3 (0.6.2) - builder - mime-types - xml-simple builder (2.1.2) erubis (2.6.6) abstract (>= 1.0.0) - flickraw (0.8.4) - json (>= 1.1.1) i18n (0.5.0) - json (1.5.3) mail (2.2.19) activesupport (>= 2.3.6) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.16) - mysql2 (0.2.11) - polyglot (0.3.1) + mysql2 (0.2.13) + polyglot (0.3.2) rack (1.2.3) rack-mount (0.6.14) rack (>= 1.0.0) @@ -68,21 +61,19 @@ GEM rdoc (~> 3.4) thor (~> 0.14.4) rake (0.8.7) - rdoc (3.8) - rest-client (1.6.3) + rdoc (3.9.2) + rest-client (1.6.6) mime-types (>= 1.16) thor (0.14.6) - treetop (1.4.9) + treetop (1.4.10) + polyglot polyglot (>= 0.3.1) tzinfo (0.3.29) - xml-simple (1.1.0) PLATFORMS ruby DEPENDENCIES - aws-s3 - flickraw mysql2 (~> 0.2.6) rails (= 3.0.9) rake (= 0.8.7) diff --git a/app/.DS_Store b/app/.DS_Store index f7bc4d4..b5cab1f 100644 Binary files a/app/.DS_Store and b/app/.DS_Store differ diff --git a/app/controllers/conferences_controller.rb b/app/controllers/conferences_controller.rb index b991196..d22c7ea 100644 --- a/app/controllers/conferences_controller.rb +++ b/app/controllers/conferences_controller.rb @@ -1,5 +1,9 @@ class ConferencesController < ApplicationController + def offline + render :layout => false + end + # GET /conferences # GET /conferences.xml def index diff --git a/app/controllers/upload_controller.rb b/app/controllers/upload_controller.rb index 53c3341..13a06fe 100644 --- a/app/controllers/upload_controller.rb +++ b/app/controllers/upload_controller.rb @@ -4,6 +4,7 @@ def index end def uploadFile post = DataFile.save(params[:filename]) + # post = DataFile.save(params[:upload]) @conference = Conference.find(:first, :conditions => ['inprogress = ?', true]) if @conference @conference.inprogress = false diff --git a/app/models/data_file.rb b/app/models/data_file.rb index 9362e3f..3bff0c2 100644 --- a/app/models/data_file.rb +++ b/app/models/data_file.rb @@ -1,19 +1,28 @@ class DataFile < ActiveRecord::Base require 'rubygems' - require 'aws/s3' + # require 'aws/s3' def self.save(upload) name = upload.original_filename + # name = upload['datafile'].original_filename - if name.length > 0 + if name #.length > 0 - AWS::S3::Base.establish_connection!( - :access_key_id => CONFIG['aws_access_key_id'], - :secret_access_key => CONFIG['aws_secret_access_key'] - - ) - AWS::S3::S3Object.store(name, open(upload), CONFIG['aws_bucket'], :access => :public_read) + # AWS::S3::Base.establish_connection!( + # :access_key_id => CONFIG['aws_access_key_id'], + # :secret_access_key => CONFIG['aws_secret_access_key'] + # + # ) + # AWS::S3::S3Object.store(name, open(upload), CONFIG['aws_bucket'], :access => :public_read) + + # local writes + directory = "public/data" + # create the file path + path = File.join(directory, name) + # write the file + File.open(path, "wb") { |f| f.write(upload.read) } + # File.open(path, "wb") { |f| f.write(upload['datafile'].read) } end end diff --git a/app/views/conferences/offline.html.erb b/app/views/conferences/offline.html.erb new file mode 100644 index 0000000..9d33981 --- /dev/null +++ b/app/views/conferences/offline.html.erb @@ -0,0 +1 @@ +Voice Board is Live! \ No newline at end of file diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 3202c7e..626f244 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,40 +7,6 @@ <%= javascript_include_tag :defaults %> <%= csrf_meta_tag %> - - - - - - - - - - - - - - - - - diff --git a/app/views/layouts/applicationx.html.erb b/app/views/layouts/applicationx.html.erb new file mode 100644 index 0000000..3202c7e --- /dev/null +++ b/app/views/layouts/applicationx.html.erb @@ -0,0 +1,50 @@ + + + + Voiceboard + + <%= stylesheet_link_tag :all %> + <%= javascript_include_tag :defaults %> + <%= csrf_meta_tag %> + + + + + + + + + + + + + + + + + + + + + +<%= yield %> + + + diff --git a/app/views/upload/uploadfile.html.erb b/app/views/upload/uploadfile.html.erb index e5a5472..c82fc80 100644 --- a/app/views/upload/uploadfile.html.erb +++ b/app/views/upload/uploadfile.html.erb @@ -2,9 +2,8 @@

File Upload

 
-<%= form_tag ({:action => 'uploadFile'}, - :multipart => true) %> +<%= form_tag({:action => 'uploadFile'}, :multipart => true) %>

: <%= file_field 'upload', 'datafile' %>

-<%= submit_tag "Upload" %><%= submit_tag "Upload" %> +<%= submit_tag "Upload" %> \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 8592c63..e928e71 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -57,7 +57,8 @@ # You can have the root of your site routed with "root" # just remember to delete public/index.html. - root :to => "conferences#index" + # root :to => "conferences#index" + root :to => "conferences#offline" # See how all your routes lay out with "rake routes" diff --git a/public/.DS_Store b/public/.DS_Store index c084d4c..7680ed9 100644 Binary files a/public/.DS_Store and b/public/.DS_Store differ diff --git a/public/data/.DS_Store b/public/data/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/public/data/.DS_Store differ diff --git a/public/data/73s.txt b/public/data/73s.txt new file mode 100644 index 0000000..a5c52f0 --- /dev/null +++ b/public/data/73s.txt @@ -0,0 +1 @@ +{"datafile"=>"73s.txt"} \ No newline at end of file diff --git a/public/data/ChrisMatthieu_Resume_Voxeo.pdf b/public/data/ChrisMatthieu_Resume_Voxeo.pdf new file mode 100644 index 0000000..2d688d1 Binary files /dev/null and b/public/data/ChrisMatthieu_Resume_Voxeo.pdf differ diff --git a/public/data/audio2174036677509342730.mp3 b/public/data/audio2174036677509342730.mp3 new file mode 100644 index 0000000..6155d39 Binary files /dev/null and b/public/data/audio2174036677509342730.mp3 differ diff --git a/public/data/audio339806556977355226.mp3 b/public/data/audio339806556977355226.mp3 new file mode 100644 index 0000000..30ce4c4 Binary files /dev/null and b/public/data/audio339806556977355226.mp3 differ diff --git a/public/data/audio5942987993304184473.mp3 b/public/data/audio5942987993304184473.mp3 new file mode 100644 index 0000000..e69de29 diff --git a/public/data/free-pass-photo.png b/public/data/free-pass-photo.png new file mode 100644 index 0000000..a6869a2 --- /dev/null +++ b/public/data/free-pass-photo.png @@ -0,0 +1 @@ +free-pass-photo.png \ No newline at end of file diff --git a/public/data/nodefussh.txt b/public/data/nodefussh.txt new file mode 100644 index 0000000..c783d15 --- /dev/null +++ b/public/data/nodefussh.txt @@ -0,0 +1 @@ +nodefussh.txt \ No newline at end of file diff --git a/public/data/vivatjesus.png b/public/data/vivatjesus.png new file mode 100644 index 0000000..d1858c7 Binary files /dev/null and b/public/data/vivatjesus.png differ diff --git a/tropo_sms.rb b/tropo_sms.rb index 705849e..43d65d9 100644 --- a/tropo_sms.rb +++ b/tropo_sms.rb @@ -4,7 +4,9 @@ require 'open-uri' require 'json' -url = 'http://voiceboard.heroku.com/api/smsnumbers/' + $currentCall.callerID + '.json' +# url = 'http://voiceboard.heroku.com/api/smsnumbers/' + $currentCall.callerID + '.json' +url = 'http://50.16.198.185/api/smsnumbers/' + $currentCall.callerID + '.json' + mymessage = $currentCall.initialText #JSON data to a Ruby hash diff --git a/tropo_voicememo.rb b/tropo_voicememo.rb index d6d06b2..454f47a 100644 --- a/tropo_voicememo.rb +++ b/tropo_voicememo.rb @@ -5,8 +5,8 @@ myvoice = "Kate" # apiurl = 'http://web1.tunnlr.com:11053' #test -apiurl = 'http://voiceboard.heroku.com' #production - +# apiurl = 'http://voiceboard.heroku.com' #production +apiurl = "http://50.16.198.185" say "welcome to the burning man voice board!", {:voice => myvoice} @@ -38,7 +38,8 @@ lastmsg = memo["conference"]["id"] memorec = RestClient.get apiurl + '/conferences/' + memo["conference"]["id"].to_s + '.json?callerid=' + $currentCall.callerID memorecdata = JSON.parse(memorec) - say "http://voicememo-uploads.s3.amazonaws.com/" + memorecdata["conference"]["filename"] + say apiurl + "/data/" + memorecdata["conference"]["filename"] + # say "http://voicememo-uploads.s3.amazonaws.com/" + memorecdata["conference"]["filename"] end end