aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2012-04-26 02:17:07 -0400
committerTeddy Wing2012-04-26 02:17:07 -0400
commit740c71c76d0a87e6903c0ab415a4f9b962ba89fc (patch)
tree62af35152de79797dfd891d22991017dc6647fd6
parent3a5c1b91af4dde0e7270d21aca356133e5f4d8d0 (diff)
downloadvideo-tuneup-stewardess-740c71c76d0a87e6903c0ab415a4f9b962ba89fc.tar.bz2
stewardess.rb: Integrated Brian's approach
-rw-r--r--stewardess.rb13
1 files changed, 6 insertions, 7 deletions
diff --git a/stewardess.rb b/stewardess.rb
index 476546c..dd7531d 100644
--- a/stewardess.rb
+++ b/stewardess.rb
@@ -6,8 +6,6 @@
require 'rubygems'
require 'sinatra'
-require 'json'
-
post '/blend/:filename' do
filename = File.join('up', params[:filename])
@@ -15,12 +13,13 @@ post '/blend/:filename' do
File.open(filename, 'wb') do |file|
file.write(datafile[:tempfile].read)
end
-
+
# Run something like:
- # length = params[:length] # Desired length (in seconds)
- # [console] python src/earworm.py -d #{length} -l #{filename}
+ length = params[:length] # Desired length (in seconds)
+ `python src/earworm.py -d #{length} -l #{filename}`
# send_file("*.mp3")
- # [console] rm *.mp3
- send_file('up/thefile.jpg')
+ send_file("up/#{filename}")
+
+ # File.delete('up/song.mp3')
end