SilverSpider Play List

Version 1.2 (January 24, 2005 1:30 PM)

Contents

Thanks

Amy of Domesticat and Scriptygoddess provided the foundation for SilverSpider Play List with her Do Something/AllMusic script, released back in 2002. I used that script on my site for quite a while, making the occasional change, so it would mesh with whatever layout I had in place. In time I added functionality, and ultimately decided to clean up all of the changes I had made so I could provide a bundled package for other to use. While I have spent a lot of time working on this script, it is important that Amy's work is acknowledged as the precursor to SilverSpider Play List. This script wouldn't exist, had she not given to the Web Development community.

License

This code is free for any and all to use as they see fit, I have licensed the work under the MIT License, which protects me, while providing total freedom to anyone who wants to use or modify this code now or in the future. A copy of the license is included at the end of this documentation.

Payment

As I said, this is free for you to use on your site, but if you find the script useful and would like to give a little something back, feel free to:

Requirements

I expect to flesh this out as other people install the script and tell me where/when it breaks...

Installation & Upgrading

  1. Download the SilverSpider Play List package
  2. Uncompress the download
  3. Create a directory on your Web server to store these files (these instructions assume the directory is called play list)
  4. Upload all of the files to the new play list directory
  5. Make sure the permissions on the following files are set to read/write on the server:
  6. Open your browser to view the test file (www.YourSite.com/play list/index.php). If you see album covers and song names, proceed to the next step. If not, check the permissions on the above files and make sure everything was uploaded properly.
  7. Download, install and configure your media player plugin (Now Playing is recommended for Winamp 5) to ping the play list code and Kung Tunes is recommended for iTunes on OS X.

Files Included with this Distribution

Upgrading 1.0/1.1 > 1.2

I modified most, if not all of the files in SSPL, so you will need to replace all of the files. Here are the steps I recommend you follow:

  1. Backup your current installation in an easily accessed location.
  2. Uncompress the 1.2 download into a local directory.
  3. Open the new config.php and your current config.php in your HTML editor of choice.
  4. Copy and paste the configuration options from your old config.php into the new one.
  5. Modify the new configuration options to ensure you are happy with the default image size, and that you have a "missing image" for the small, medium and large album covers.
  6. Modify the new configuration options to poitn at the proper override files for the album name and artist name override files.
  7. Make sure to copy any albums that you have placed in the $VariousArtists array to the new various artist override file. Note the change in format, and the fact that you no longer need to escape quotes.
  8. When you are confident that everything is as you want it, upload the new files to your server.

Configuration & Display Options

Configuration

All of the configuration options are located in config.php. Each is explained within that file.

Album Cover Override File Format

The album cover override file is set up to have one override per line. Each override line contains the artist name, the album name, the URL to the small image, the URL to the medium image and the URL to the large image, each of which is separated by two pipes (||). Here is an example of an override:

The Guy Forsyth Band||High Temperature||http://images.amazon.com/images/P/B0000005F7.01.THUMBZZZ.jpg||http://images.amazon.com/images/P/B0000005F7.01._SCMZZZZZZZ_.jpg||http://images.amazon.com/images/P/B0000005F7.01._SCLZZZZZZZ_.jpg

Artist Name Override File Format

The artist override file is set up to have one override per line. Each override line contains the album name two pipes (||) and the name that should be used when querying Amazon. An example of some of the overrides:

An Anthology of Big Band Swing||Various Artists
Give 'em the Boot||Various Artists
Lost Highway||Angelo Badalamenti
Pulp Fiction||Various Artists
Rise Above||Various Artists
Swingers||Various Artists
Trainspotting||Various Artists
Twisted Willie: A Tribute To Willie Nelson||Willie Nelson (Tribute)

Display Formats

The differences in the format are rather small. The key difference between each is the HTML they output. As there aren't any styles automatically applied to the formats, it is difficult to see the difference without looking at the source code. What differences there are provide flexibility to people who need precise control over the output. Some people would like to keep it simple, and just output an anchor tag with information, others would like to output the albums in a list, or each within a div. So, I provide three major options, each with two variants:

Usage

Static vs. Dynamic Listings

SilverSpider Play List provides two methods for you to include your play list on your site, a static version and a dynamic version. The key difference between the two is that the static page is updated by SSPL as soon as a new song is sent to it, whereas the dynamic list is built every time it is viewed. So, if you use the dynamic version on the main page of your Web site, every time somebody views the page, SSPL processes your play list and builds the output. This can add a lot of extra processing to your server and add a few seconds to the amount of time it takes to load your page. I highly recommend that you use the static version.

I have kept the dynamic feature in the package, as it is possible that someone may want to show a list on a page that has different features than what they show through the static version. For example, I have set up my static list to show six albums in format 1, but perhaps I want to show the last 10 albums in a different format on a special page. All I have to do, is include the dynamic PHP call, which includes how many songs I want (10) and the format to display it in, and the play list will be built and displayed right there.

The dynamic version also benefits anyone who wishes to extend the the package as they can easily hook into the scripts with a single call.

Display the compiled static file

  1. Add the following line to any page/template that will display your Play List, making sure to change [Full Path To Play List Directory] to list the actual path on your server:
    <?php include("[Full Path To Play List Directory]/playlist.html"); ?>

Display a dynamic listing

  1. Add the following line to any page/template that will display your Play List, making sure to change [Full Path To Play List Directory] to list the actual path on your server:
    <?php include("[Full Path To Play List Directory]/playlist_display.php"); ?>
  2. Add the code to call display the play list, change the first option to control how many songs to show, the second option to control which format is used for display and the fourth image to control the size of the album covers:
    <?php show_playlist(6, 1, '', 'Small'); ?>

CSS

Two classes are used in the output created by these scripts. They are named them in a way that should avoid any problems with pre-existing CSS classes.

Feedback, Questions & Suggestions

Contact Me

I would love to hear your what you think of this code as well as any suggestions that you may have. I am also more than happy to answer questions as they arise (and as my schedule permits). So, feel free to contact me.

Official Site

Updates and other information regarding SilverSpider Play list can be found at playlist.silverspider.com.

Version History

Version 1.2

January 24, 2005 1:30 PM

Version 1.1

December 29, 2004 3:27 PM

Version 1.0

November 26, 2004 11:33 AM

Changes from RC 1 are:

Other Notes

PHP Paths

Some server configurations require that PHP includes use the full system path to reach a file. So you may need to use:
<?php include("/[Full Path To Play List Directory]/playlist.html"); ?>
instead of:
<?php include("playlist.html"); ?>

This may also require that you change the include/require paths in

Play List File

I have yet to build in a mechanism for periodically cleaning up the play list file (playlist.txt), so it will grow with every song you play. While it is made up only of plain text, I recommend that you crop it to a manageable number every so often.

Legalese

Copyright © 2004 Alex Jones

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.