Some of you may have played around with DoSomething, a WinAmp plugin that allows you to generate songlists. While originally intended for Shoutcasters, I fell in love with this plugin over a year ago, and have been using it ever since to generate automatically-updated lists of the songs that have recently played in WinAmp.
Requirements: WinAmp, DoSomething plugin, PHP, and a FTP account.
(Setting up DoSomething is a bit beyond the scope of this post, and there's a tutorial here.)
This code takes specially-formatted output from the DoSomething plugin and generates a nicely-formatted list of recent songs. The artists' names are linked to allmusic.com in the appropriate format, and if an album title is available, it is made available to the reader in the form of an <acronym> tag around the title of the song.
This particular update changes the code to a function—in this case, show_playlist()—something I should have done months ago. I've also set up the function so that it has the following three parameters:
show_playlist($number, $title_separator, $line_separator);
$number tells the function how many songs to display. $title_separator should be encased in quotation marks, and tells the function what characters to place between the artist's name and the song title. (Common ones will be " – " or "<br>".) $line_separator does the same thing, except between songlist entries. (I generally use "<br><br>" or "<br>".)
Thus, an end result might look like this:
show_playlist(3, " – ", "<br>");
and display output in the following format:
artist of song – title of song (line break)
artist of song – title of song (line break)
artist of song – title of song (line break)
This is a major rewrite of the previous script, with a lot of error-correction added (as well as flexible support for album titles). You can download the .zip file here, or read my full entry about the files. This script is currently in usage at domesticat.net, if you want to get an idea of what the output looks like.