Winamp playlist

I first came across the winamp recently played list on Janne's blog. He had already written a good entrie about the things required to make it all work, but he did not get into the more technical lingo, or even to show some of the code that he used to make the whole thing work. So I decided to take it a step further for all you bloggers who want to show the world what you're listening to while you're behind your computer.

Ingredients

Don't worry. It's a very short list :)

Configure the plugin

I will trust you can make it to this point on your own, if not there are suitable instructions on the Winamp and Now Playing plugin home page.

But the documentation on configuring the plugin was a bit vague, at least to me. They forgot to mention to enable the plugin :)) Check the image for the settings I chose and where you find them.

Settings for the now playing plugin

Now everytime a song changes the plugin sends the information about the current song to the url you provided, wich points to a PHP script we'll discuss next.

The script

This script is part of a larger CMS framework, but the idea is the same as in a normal script. Let's take a look:

if ($_POST['Playing'] == 1) {
// we can add the mp3 info to the database
$query = "INSERT INTO winamp_playlist VALUES
('0', '".$_POST['Artist1']."',
'".$_POST['Title1']."', '".time()."')";
$result = $db->query($query);
}
exit();

As you can see everything is pretty straightforward. The database contains only an id, artist, title and the time the song was played. However, the condition is worth noting. The Playing parameter is 1 if Winamp is acctually playing the song. Here's some more info on the remaining parameters.

Parameters which are sent are:
Playing = 1 - WinAmp is playing the track, 0 - WinAmp is stopped.
Artist1 = Artist of currently playing or last played track.
Title1 = Title of currently playing or last played track. Album1 = Album of currently playing or last played track.
Year1 = Release year of currently playing or last played track.
Track1 = Track number of currently playing or last played track.
Length1 = Length of currently playing or last played track.
Genre1 = Genre of currently playing or last played track.
Quality1 = Quality of currently playing or last played track.
Comment1 = Comment of currently playing or last played track.
Filename1 = Filename of currently playing or last played track.

So all you have to do now is sit back and listen to some music and let the plugin do its thing.

tags: ,

Social bookmarking:

doen, posted on 19th of August 2005 @ 10:58

gravatarIs there a way to make something like this work with iTunes? I guess the PHP part would be mostly the same, you'd just need something like the Now Playing plugin, except for iTunes, right?

Miha, posted on 19th of August 2005 @ 12:40

gravatarSure thing :)

Now Playing: An iTunes for Windows Plugin. Haven't tried it yet but it looks like the right one to try.

Andy Merrett, posted on 19th of August 2005 @ 15:50

gravatarOK, and now an iTunes for Mac plugin please ;)

Miha, posted on 19th of August 2005 @ 16:00

gravatarHere you go :)

iTunes Watcher

But you're on your own on this one :)

doen, posted on 19th of August 2005 @ 16:15

gravatarYeah, that's kinda what I was going for :D The Mac version (gotta be prepared ;))

Pascal, posted on 19th of August 2005 @ 16:58

gravatarReminds me of AmaroK and how it automatically interfaces to musicbrainz and a few other playlist static sites... In fact did you know Amarok interfaces to lycos for instant lyrics and wikipedia for artist and background info?

Got to love free software :-)

Cheers,
Pascal

Andy Merrett, posted on 19th of August 2005 @ 20:11

gravatarCool thanks Miha. You have a lot of links :)

Soon everyone can know what weirdness I listen to! Oh no...

Miha, posted on 20th of August 2005 @ 17:44

gravatarThanks for the info Pascal. I took a quick look at AmaroK and it looks great. Too bad I don't have Linux at the moment, but I will give it a try as soon as I install it again :)

Andy, don't even mention it :)

Post your comment

Comments are clossed (more than one month has passed since this entrie was published). If you still wish to comment the entrie, please do not hesitate to contact me.


Recent entries

Star entries

Currently reading

Advanced PHP Programming

Worth a look

Flickr

Pediatricna klinika