PuseyUK (Return to "Home" page) The Pusey Family Homepage
Google UK
 
 

Home

About
Site News

Downloads
Forum
Gallery
Playlist
Portfolio
Other Stuff
Family History

Contact
Feedback

NEW Free Delivery on orders over £25

Portfolio - Winamp xmlParser

Current Version: 2.0

What's New: Most of the script was rebuilt from scratch to improve both performance and flexabillity. Script can now handle quote marks in the track title, as well as being able to now download the playlist from a remote URL if required. Click here for full version history.

Bug Reports & Feedback: portfolio@puseyuk.co.uk

Download


ATTENTION: The current version of the WinampXML Parser is NOT compatable with Winamp 5. This is because Winamp 5 does not have the abillity of exporting playlists in the B4S format. We are currently developing a work-around for this. Please watch this space for futher developments. In the meantime, you can download Winamp 3 (which is compatable) by clicking here.

The Winamp xmlParser is a free open-source PHP script for parsing XML playlist files generated by Winamp into a table for publication on a webpage. Below is a sample playlist generated by Winamp.

Playlist XML Sample

As you can see, each track has its file name and path, its name, and its length (in milliseconds). All my scripts does, is to scan the file and pick out all the <Name> and <Length> tags, and arrange the data they contain into a table for viewing as a webpage.

The script is written using PHP 4.3.0 and requires the XML Parser extension to be installed into PHP (see http://www.php.net/manual/en/ref.xml.html). Also, the Filesystem functions must be enabled (see http://www.php.net/manual/en/ref.filesystem.html). To use the script, simply insert

<?

// *************************************************************************
// CONFIGURATION OPTIONS... CHANGE THESE ACCORDING TO YOUR REQUIREMENTS!

// xmlURL: This is the location of your Winamp XML file. It can be either a webserver filesystem path or an internet URL.

$xmlURL = $_SERVER['DOCUMENT_ROOT'] . "/winamp.b4s";

// linkclass: This is the CSS class used for all hyperlinks in the output (use "" for none)

$linkclass = "";

// END OF CONFIGURATION OPTIONS... DO NOT CHANGE ANYTHING BELOW THIS LINE!
// *************************************************************************

include("winampxml.inc.php");

// *************************************************************************

?>

into the page where you wish the playlist to be displayed (changing the values of the configuration variables as desired), and upload the winampxml.inc.php file into the same directory as the displaying page. No CHMODing or file permission changes are required. All you need to do now, is to open Winamp and export the playlist (see below).

1. On the playlist editor, press the "Playlist" button, and then select "Save playlist as..." from the dropdown menu.

Step 1

2. Save the file, ensuring that the file type is set to "b4s playlist" and press the "Save" button.

Step 2

 

Now that you have the playlist exported and the script configured, you can test it but entering the displaying page's URL into your browser. You should see an output similar to the output used on this site (see http://www.puseyuk.co.uk/playlist.php).

 

Site Version 2.2

PuseyUK is the personal trademark of the Pusey family (Isle of Wight) © Dave Pusey 2002 to 2009.
Website Design & Content © Dave Pusey 2003 to 2009. All rights reserved.

Powered By: PHP & MySQL.

Page generated on 3rd July 2009 at 05:52:18 (GMT +0100).
PHP script execution took 0.0004 seconds.