MusikCube Now Playing

There is not much that I like more than music and so I am always looking at new players. I ended up stumbling across one named MusikCube and I have been rather impressed with it so far. What I like most about it is that unlike other similar programs this one has built in functionality for tracking your play history with your website. The program provides access to php $_GET variables passed in a url.

I did not find many contributions regarding this though and I did not find any example code for any language so I decided to write a script in php that will track your tracks as they are played and store all the info to a MySQL database. The script then allows you to view the (x) most recent tracks played in xml format. I found a quick little example on php.net for parsing xml that I modified to display the track information in your website in your sidebar or wherever you decide.

First if you have not already, go download and install the MusikCube player.

Next download our example script and upload both included files to your server.
Open played.php and edit the $config array with values to reflect your setting options for database and tracks to show. After that is done save the file and close it. Open example.php and set $now_playing_uri to http://yourdomain.com/played.php were yourdomain.com is the name of your domain.

Start up MusikCube and get listening :) As you listen the database will update with the tracks. When you load the example.php in your browser you will see the recent tracks you have listened to.

TODO:
Modify the code in example.php to suit your needs and incorporate into your site.
You may also want to set up a cron or something to export this data since if you are like me the player will never stop and that accumulates some serious amounts of data.
You could modify the played.php to output all records from a date until a date and then save it so you could later use the xml to output statistics for how many times a specific track has been played.

See below for an example of the script in action

Download MusikCube Now Playing PHP Script
 MusikCube Now Playing PHP Script Download Count

{NOW_PLAYING}




Advertisement



BBC Entertainment News

  • July 30, 2010
  • Balding complains over sex jibe
  • Sports presenter Clare Balding makes an official complaint to the Press Complaints Commission over an article which mocked her sexuality.

  • July 30, 2010
  • DeGeneres leaving American Idol
  • Comedienne and chat show host Ellen DeGeneres is leaving American Idol after one season on the judging panel.

  • July 30, 2010
  • Ben Shephard says goodbye to GMTV
  • Ben Shephard bids farewell to GMTV after 10 years telling viewers Im going to miss all of you, every single one of you.

  • July 30, 2010
  • Awards double for Valentine band
  • Welsh rock band Bullet For My Valentine scoop two prizes at this years Kerrang Awards, including best British group for the third year running.

  • July 30, 2010
  • Holden to star in Shrek musical
  • Britains Got Talent judge Amanda Holden lands a starring role in Shrek The Musical, which is coming to Londons West End next year.


RSS feeds



Recently Online