Skip to content

Instantly share code, notes, and snippets.

@gnarl
Created November 11, 2011 03:52
Show Gist options
  • Save gnarl/1357141 to your computer and use it in GitHub Desktop.
Save gnarl/1357141 to your computer and use it in GitHub Desktop.
My Sun Eyed Girl
# itunes_service.rb
require 'sinatra'
require 'json'
require './applay'
get '/music/play' do
ItunesAppScript.new.play
end
get '/music/song/:song' do
ItunesAppScript.new.play_song(params[:song])
end
get '/music/show/:artist' do
list = ItunesAppScript.new.songs_by_artist(params[:artist])
content_type :json
list.to_json
end
get '/music/stop' do
ItunesAppScript.new.stop
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment