Clik here to view.

Update: People keep finding this post in search engines, I’ve continued to work on my mashup codebase and complain about PHP, web services, and documentation. I’ve written way more PHP than I ever wanted to write…
Original Post
I haven’t made too much progress on my mashup. I’ve run into a few more inconsistencies in documentation and implementations of various APIs. So I’ve had to spend time debugging other people’s code and have discovered shortcomings in documentation and just plane errors. Arguments that are said to be optional that really are required…
With the Amazon API letting me down or at least these instructions, I couldn’t find anything better in the real Amazon API documentation so I left a question on their forum.
With no answers forthcoming I had to look around for alternate ways to get tracks and audio previews. iTunes Music Store should have this information, but they don’t take Canadian affiliates so I wouldn’t get any money if anyone bought anything. That wasn’t even on the radar when I decided to build my CD Cover Gallery, but after putting in so much time and effort into the code and deciphering various APIs and their responses. I tried to make my code as versatile as possible and reuse-able too. Alas the more I work on it the more shortcomings and missing features I find in various PHP implementations of APIs.
I tried MusicBrainz. I’d read that it was a good source of free music information. Their API documentation isn’t the best. But as I was writing my own methods, I learned of phpBrainz. So I decided to switch my efforts to using Scott’s code but it wouldn’t even run right out of the source control system. In fact the link from MusicBrainz.org doesn’t go to the source control system that comes up number one in Google for phpBrainz…
I ended up implementing some methods for the Last.fm API that I didn’t know were missing from Matt’s PHP. I also discovered that the getInfo
method in album.php doesn’t copy the track information from the XML to the array Matt insists on returning for abstraction purposes. So I think I’ll be implementing that next. However the more I work on this “small” project the more I find I need to fix and modify other people’s code so it works like it should. This means anyone looking to use my code would need all the modifications and additions I’ve made to other PHP codebases in order to get my stuff to work.
Most of the work for my albumCollection.php class is done by two methods, one in the Last.fm API to get information about an artist and another in the Amazon Product API to get information about an album. Now I can get information from MusicBrainz and I plan to get more information from Last.fm, iTunes Music Store, and possibly Amazon if someone tells me what attribute is mandatory that isn’t listed as mandatory in the documentation…
I don’t think people in PHP land test their code enough before they throw it online and tell people to download it and use it. I’m not sure a full suite of unit tests needs to be written for every class and method, but when your codebase is linked from an official website and you repeatedly say it is the best and easiest way to do something in PHP, perhaps you should make sure when you download it from the source control system, it actually will run the example code included…
How much of an obligation do people have to ensure their code works when they create a semi-official implementation of an API for a Web Service and then encourage people to use?