Ruby on Rails: get media player information (iTunes, TRAKTOR, Cog, current song + playlist)

I want to write a small web application that does the following:

  • deliver a web page to display the current song and some metadata
  • provide a web api that may be requested for the next song so that the page refreshes without page loading.

There is no big deal, the only part I can’t appreciate is access to the current iTunes song , TRAKTOR and, if possible, Cog from the ruby ​​on rails app.

It would be especially nice if I could access the playlist to display the next song.

+1
source share
2

applescript . Traktor Pro Coq, , AppleScript Dictionary viewer OS X Script Editor. iTunes :

osascript -e 'tell application "iTunes" to get name of current track'
osascript -e 'tell application "iTunes" to get name of every track of current playlist'

rails ( ) :

def show
    @current_track = `osascript -e 'tell application "iTunes" to get name of current track'`
end

...

<h1>The current track is: <%= @current_track -%></h1>
0

, , iTunes . , : http://code.google.com/p/itunes-rails/

, iTunes. .

+1

All Articles