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.
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.
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:
I expect to flesh this out as other people install the script and tell me where/when it breaks...
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:
All of the configuration options are located in config.php. Each is explained within that file.
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
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)
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:
<a href="[LINK TO AMAZON]" class="SSPLImage"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /><span>[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</span></a>
<a href="[LINK TO AMAZON]" class="SSPLImage"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a><a href="[LINK TO AMAZON]" class="SSPLInfo">[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</a>
<li><a href="[LINK TO AMAZON]" class="SSPLImage"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /><span>[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</span></a></li>
<li><a href="[LINK TO AMAZON]" class="SSPLImage"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a> <a href="[LINK TO AMAZON]" class="SSPLInfo">[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</a></li>
<div><a href="[LINK TO AMAZON]" class="SSPLImage"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a> <a href="[LINK TO AMAZON]" class="SSPLInfo">[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</a></div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[SONG NAME] by [ARTIST NAME] from the album [ALBUM NAME]</a></div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[SONG NAME]</a></div><br />[ARTIST NAME]<br />[ALBUM NAME]</div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[SONG NAME]</a></div><br />[ALBUM NAME]<br />[ARTIST NAME]</div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[ALBUM NAME]</a></div><br />[ARTIST NAME]<br />[SONG NAME]</div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[ALBUM NAME]</a></div><br />[SONG NAME]<br />[ARTIST NAME]</div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[ARTIST NAME]</a></div><br />[SONG NAME]<br />[ALBUM NAME]</div>
<div class="SSPLImage"><a href="[LINK TO AMAZON]"><img src="[LINK TO AMAZON IMAGE]" alt="[ALBUM NAME]" /></a></div> <div class="SSPLInfo"><a href="[LINK TO AMAZON]">[ARTIST NAME]</a></div><br />[ALBUM NAME]<br />[SONG NAME]</div>
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.
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.
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.
Updates and other information regarding SilverSpider Play list can be found at playlist.silverspider.com.
Changes from RC 1 are:
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
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.
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.