Muschamp Rd

CD Cover Gallery is pretty much done

October 7th, 2010
CD covers

I made my albumCollection.php class versatile enough that it was easy to just crank out an album cover gallery. I spent most of my time in the last 24 hours fixing up the csv file so that the maximum number of album covers can be found in Amazon.com. It still doesn’t find them all and it gets a few wrong, but it does a pretty good job all things considered. With all the requests cached it loads fast enough, but I wonder how it will perform in a weeks time when it needs to re-fetch data.

Update: the PHP code used to make this gallery and other web mashups is available for download as open source, but all the APIs have changed and I have not updated it in a long time. I can’t recommend using it at this time nor relying on any one API heavily as there seem to be less and less free and open APIs and more and more restrictions on what you can do in 2019.

One thing the gallery was good for, is showing which albums have good graphic design. The album cover is recognizable, the title or artist name stands out. You can also see how the change to CD has changed album cover design. Now text often takes up more space, though some people still design album covers the old fashioned way. You can also see how the early days of desktop publishing in the 80s affected album cover design.

My working CD Cover Gallery

One annoyance is Firefox, at least on the Mac, it doesn’t render the way I want. The Last.fm Records plugin has the same issue. I put every album in a LI tag and inside that is a link and an image tag. I set all the borders, padding, and margins to be zero, but still in Firefox it leaves a gap of a few pixels. I’ve tried a few things, but if anyone has a quick fix for this I’d appreciate it.

My cover gallery only uses the Amazon Product API but I created the albumCollection class in such a way that it can interact with five APIs: Amazon Product API, Last.FM, Facebook, iTunes Music Store, and Twitter. The first two are the most deeply integrated, I spent a long time looking for PHP APIs or SDKs or at least example code, with less than stellar results. In fact the state of Amazon PHP code, caused me to create a much more elaborate Object Oriented solution than I needed just to show that it can be done. Amazon by far gave me the most trouble and it is still giving me grief.

I fear Amazon may have finally rescinded my access to their API, I just don’t generate any sales.

Lightbox close up of album cover

Last.FM has a really elaborate API and a fan created PHP class to access it. For the most part it works, but Last.fm didn’t give me the information I wanted quickly so I turned to Amazon. Facebook has its own PHP SDK which I barely use, I also barely use Vadim’s library. I found the less code I used from other people, the better things seem to go. I just create my own search string, then use CURL, then parse the results. I let my client code do most of the formatting, that way my class can be used for a few different purposes.

Nowadays I don’t program much in PHP. I did learn Python after passing all three CFA® exams but I still ended up unemployed again. I can’t recommend learning PHP at this point unless you want to work with WordPress or some other specific codebase. JavaScript seems to be more desirable in 2019. I’ve spent too much time programming for free so I’m not enthusiastic about having to fix this old PHP code again, but if you have any advice you can leave it below.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Posts on Muskblog © Andrew "Muskie" McKay.
CFA Institute does not endorse, promote or warrant the accuracy or quality of Muskblog. CFA® and Chartered Financial Analyst® are registered trademarks owned by CFA Institute.