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 a 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.
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 little review or 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
- 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, after all I am looking for a job.
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…