CD Collection Browser Mashup is basically done
October 14th, 2010Although I’m not happy with the track listing portion. I wanted to get previews of the songs on the album and I thought I could get this information from Amazon Product API, I even found an example of what needed to be done, but I couldn’t get it to work. I asked for some help on their forum, but no one replied. Eventually I moved on to using a variety of other APIs.
Sometimes I can get previews or link to a page with an audio preview or even the whole song, but sometimes I can’t even find a track listing. I also discovered, even with a fair amount of caching, going from fetching information about an artist or an album, to fetching information about the tracks on the album, increases the number of API calls by a factor of ten or more. So I may revisit that, maybe just have a preview of the first track.
In the mean time check out my CD Collection Browser Mashup. It isn’t that interactive, that area of PHP isn’t one I know much about, I suspect I need to use some JavaScript. Since I’m still unemployed, I plan to build another mashup or two. My PHP class representing a collection of albums is working alright, though it relies on a variety of other API accessing code in PHP which isn’t always flawless, I’ve had to extend, debug, and add to most of the code I’ve downloaded off the net for this project. This means anyone who wants to use my code, would have to go through a similar headache. Not sure if there is a solution to this, other than cloning my installation.
I plan to make a subclass as my main class has gotten fairly large, it works just like a crate of records. You can pick up the first record, the last record, or a random record in the crate, pull it out, read the tracks, look at the album cover, maybe a brief review or an artist bio. The class works just like a real record collection, that is abstraction or Object Oriented Programming or something. I used a lot different techniques from recursion to refactoring to probably some design patterns. I ended up writing a lot more code than I originally planned when I set out to build my CD Cover Gallery, but after seeing the state of PHP code that is being advocated as a solution to accessing the Amazon Product API, well I decided I would show people how it was done.
This mashup and my class uses the following APIs and code by the following people:
- Amazon API by Sameer Borate
- Signed AWS Request by Ulrich Mierendorff
- Last.fm API by Matt Oakes
- Facebook PHP SDK
- FacebookLib by Vadim Gabriel
- MusicBrainz.org
- phpBrainz by Jeff Sherlock
- Twitter’s Tweet This Button
- Facebook Open Graph
- Facebook Like Button
- iTunes Store Search API
Late last night while testing this, I chanced upon the Hype Machine as it has tight Last.fm integration, so I plan to explore that website some today. I also should really tell people about what I’ve been building, well beyond the dozen or so semi-loyal blog readers I have.
I eventually wrote more code and made more mashups, the code is available for download, but the more APIs I used the more headaches it likely caused to anyone wishing to use just a little of the code. It also needs updating, but right now I’m updating old blog posts and looking for a new job. I never set out to write so much PHP code, but you’re welcome to try it, make sure you read up on open source licensing too.
This entry was originaly posted on , it was last edited on and is filed under: Technology and tagged: Amazon, API, iTunes, Last.fm, PHP.
Just so you’re aware of it:
As you have used a GPL licensed piece of code (phpBrainz) in your project you are required to release the source code of your application and make it public under the same licence (GNU GPL). This is true if you made any changes to the code or not. If you don’t want to release your code you can just remove the use of that library :)
Now phpBrainz, that didn’t even run out of the repository. Someone checked it in with half declared methods in one class. That’s just bad programming regardless of whether it is open source or not. You should at least compile and test your code and the last person to check in phpBrainz obviously didn’t test the Release class as that was the one I immediately wanted to use.
I don’t really have a problem giving away code, lord knows I’m no PHP guru. I taught myself PHP while I was unemployed and since I’m unemployed again, I got around to updating my website, and since I got rid of the low hanging fruit I decided to try building something in PHP.
I did send fixes to you and the FacebookLib guy and maybe someone else. I’m not really up on all the open source source code repositories. I thought everything was in SourceForge, but apparently it has competition. phpBrainz is in multiple repositories, which is the most up to date copy? That is what I asked but didn’t get an answer, I used the one linked to from MusicBrainz.org
I suppose I could try harder to upload my fixes, but mainly I just want to get stuff done so rather than re-invent the wheel or write methods that are already written I looked around for if not APIs at least examples. Often the documentation leaves something to be desired on some of these APIs. I’m actually almost finished another mashup, but I have bigger fish to fry too. Maybe I can look into synching my changes with the source control system later this week.
Cheers,