Muschamp Rd

CD Cover Gallery PHP Code

October 29th, 2012
CD covers

After finally getting my web mashup code into GitHub I spent a lot of time ensuring the code was easy to read and well commented. Now in 2019 a lot of methods no longer work because of changes to the APIs. I may be able to fix it, but I don’t have the time at the moment.

Back in 2012 I had a number of theories on why the CD Cover Gallery in particular works less well:

  • Far from optimal PHP coding technique
  • Too much overhead from adding more APIs
  • Slow WiFi based Internet connection
  • Use of flat files for caching
  • Large dataset with lots of difficult data
  • Lack of underlying database
  • Browser or server limitations
  • Use of lightbox javascript
  • API throttling

Amazon Product API is a harsh mistress

Now in 2019 this mashup is no longer returning any album covers and I think it is because Amazon once again changed their API usage policies. They may have even stopped me from using their API because I didn’t generate enough or possibly any sales.

Although there are 545 lines in my CSV file. Each of these lines corresponds to one or more CDs not all of which have a ‘cover’ that can be found in Amazon, iTunes, or Last.fm. I could never find 545 album covers eventually I switched to just my favourite albums but even that may be too many calls to Amazon’s API in 2019.

What about Last.fm?

I definitely found some bugs or issues with the last.fm API or Matt’s code. There have been some fixes over the years but Last.fm is also changing their API. There seems was an issue with album titles or artist names containing an apostrophe, such as Howlin’ Wolf.

What about MusicBrainz

I did fix the apostrophe issue and I did try MusicBrainz but Amazon was the best API for finding album covers. I tried Apple APIs and Best Buy’s API. I wrote and gave away a lot of PHP code and I could never find every album cover I was looking for and the more calls you make the slower the code runs. If I revisit this code I will make the code leaner and meaner. I was unemployed too long and wrote too many methods. In 2019 I only really care about my quotation mashup.

If you have any advice or ideas you can leave a comment below. A lot of code has presumably been written since October 2012 maybe I’ll get lucky and someone has fixed some of the issues I’m now encountering. But in my experience you rarely get lucky with PHP.

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.