SZTracker Winamp plugin
SZTracker is a plugin for Winamp 5 that post song information to a desired URL. You can use it to log all the songs you have been listening to, or just show the latester song you played.
If you're competent enough with PHP you can make all sorts of lists, like most played songs, artists or albums. 10 most recent artists, songs or albums.
For those of you who are WordPress users like me I've made a simple plugin and a widget for WP. It's available [here]

Features
- Supports ID3v1.x
- Supports ID3v2.x
- Will only send ID3v1 information if ID3v2 tags wasn't found.
- Option to authenticate song submission with a password
- Full support for Wordpress 2.x with my WP Plugin
Installation
Create the table to store the data in.
-
CREATE TABLE `musiclist` (
-
`id` bigint(14) UNSIGNED NOT NULL AUTO_INCREMENT,
-
`last_played` bigint(14) UNSIGNED NOT NULL DEFAULT '0',
-
`artist` varchar(100) NOT NULL DEFAULT '',
-
`album` varchar(100) NOT NULL DEFAULT '',
-
`title` varchar(100) NOT NULL DEFAULT '',
-
`filename` varchar(100) NOT NULL DEFAULT '',
-
`hits` int(10) UNSIGNED NOT NULL DEFAULT '0',
-
PRIMARY KEY (`id`)
-
) TYPE=MyISAM;
Usage
This is a simple php script that will use the above database table to store played songs. It will increase a counter on songs played more than once. This will create an interesting database of your most and least popular songs!
-
<?php
-
require_once('ExceptionHandler.class.php');
-
require_once('MySqlInterface.interface.php');
-
require_once('MySQLHandler.class.php');
-
require_once('Database.class.php');
-
$Database = new Database();
-
$artist = $Database->real_escape_string($_POST['artist']);
-
$title = $Database->real_escape_string($_POST['title']);
-
$album = $Database->real_escape_string($_POST['album']);
-
$filename = $Database->real_escape_string($_POST['filename']);
-
-
$data = $Database->sqlQuery("SELECT id FROM musiclist WHERE artist = '".$artist."' AND title = '".$title."' AND album = '".$album."'");
-
if ($data) {
-
$Database->sqlQuery("UPDATE musiclist SET last_played = NOW()+1, hits = hits + 1 WHERE id = ".$data[0]['id']."");
-
echo 'Update';
-
} else {
-
$Database->sqlQuery("INSERT INTO musiclist (last_played, artist, album, title, filename, hits) VALUES (NOW()+1, '".$artist."', '".$album."', '".$title."', '".$filename."', 1)");
-
echo 'New';
-
exit;
-
}
-
} else {
-
echo 'Wrong password';
-
}
-
?>
The above example takes use of my database class MySQLHandler 2.0. It's required for the example to work.
To do
- Option to send data as an XML string
- Possibility to write ID3 tags while playing the song. At the moment it cannot since winamp is using the file (duh)
Why ID3v2 only?! *cry* … I can’t change all my songs to ID3v2!!
Thank you for your interest in my plugin

I’m working on a new version with 1.0 and 1.1 support, so you don’t have to change all your songs, I’m not that evil
Come back in a couple of days and version 1.1 will be released, I’m currently running test on it.
Do I need to do all this for the wp plugin too? I uploade, activated etc as per instructions but nothing is showing up except an error in my widget.
“Warning: Invalid argument supplied for foreach() in /path/a-touch-of-tude/home/wp-content/plugins/sztracker/wp-sztracker-widget.php on line 39″
I put the sztracker_tracker.php where my index.php is, I put the folder, excluding that file in my plugins folder, activated both, and I’m still getting the error.
Do you need to do all what for the wp plugin?
You need to setup the Winamp plugin so it submits song information to the sztracker_tracker.php, if your song table is empty, that might be what causes the error
I was asking if i needed to set up the table etc. However the table is in my wp database so that’s not a problem anymore. and I have configured the player to the best of my ability. I found no where detailing excactly what URL it is supposed to submit to in the instructions for either the player plugin or the wp plugin. I’d really like to get thi working as every other widget of this sort requires the user to jump through too many hoops.
I do not know how you have configured your Wordpress installation but in most cases it would be http://www.example.com/sztracker_tracker.php
hmmm whatever it was fixed itself…very strange. Is there a page that has all the tracks listed that can be displayed too? or just the widget with the single track?
I have it in a subdirectory, but it’s working now:o) Still not sure what the heck happened but it’s listing the songs now. .wma listing would be nice though:o)
great it’s working

yes, wma support would be nice. It’s on my todo-list
a nice stats page would be awesome too..something like 10 most played, current tracks, etc. Nice little plugin, thanks for the help:)
1. Why the plugin freeze winamp while sending data?
2. Any idea to send WA’s rating (5 star like) or just like ‘LOVE’
function at last.fm software scrobbling?
3. Does your plugin send more data then provided in ‘configuration’? I
mean your site tracking some of them?
But away: nice plugin!
bonus: Can you add internal reading of winamp’s meta data such as
%tracknumber%
%title%
%filename%
%artist%
%album%
instead of your ID32/1.1 reader?
It’s gives a possibility to read tags from all of filetypes played in WA, for example CDDA (CD Audio, now it gives ‘cda://Y,1′ values within your great plugin)
Also, great if you add some specific tags, exept password, for example ‘user_id/machine_name’ (of course it can be done though additional get request in URL ../sztracker_tracker.php?additionaltag=value)
songs…
Have a nice trip!…