It fuckin' works\!

This commit is contained in:
magnolia-fan
2011-04-10 07:17:34 +04:00
parent 135f10d73a
commit 259cbd6a84
4 changed files with 50 additions and 36 deletions
+9 -5
View File
@@ -2,12 +2,16 @@ class TrackController < ApplicationController
require 'net/http'
require 'uri'
def listen
artist = 'The White Stripes'
track = 'Blue Orchid'
length = 157
pp track = Track.where(:id => params[:id].to_i).first
pp release = Release.where(:id => track.release_id).first
pp album = Album.where(:id => release.album_id).first
pp artist = Artist.where(:id => album.artist_id).first
Vkontakte.get(artist, track, length)
data = Vkontakte.get(artist.name, track.name, (track.length / 1000).round)
#data = open('/Users/chez/Sites/beathaven/tmp/media.mp3').read
#send_data data, :type=>"audio/mp3"
render :json => 0
#render :text => data
redirect_to data
end
end