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}



BBC Entertainment News

  • February 04, 2012
  • Acting veteran Ben Gazzara dies
  • US film and Broadway actor Ben Gazzara has died in New York at the age of 81.

  • February 03, 2012
  • Poster threat to Dujardin Oscar
  • Movie billboards in Paris featuring The Artist actor Jean Dujardin might affect his chances of winning an Academy Award, according to French press.

  • February 03, 2012
  • Kings Speech premieres on stage
  • Almost a year after the film reigned supreme at the Oscars, the stage version of The Kings Speech has its world premiere.

  • February 03, 2012
  • Gospel singer David Peaston dies
  • RB and gospel singer David Peaston, best known for the tracks Two Wrongs Dont Make it Right and Can I, dies aged 54.

  • February 03, 2012
  • Grant on board for Jones film
  • Actor Hugh Grant will star in the third Bridget Jones movie, despite recent reports that he had pulled out of the sequel


RSS feeds



Recently Online