Brian Wood, this one's for you

A few people have said they'd like to see an official Last.fm Drupal module, hosted on CVS. I have been using it on my own site, but I have hacked Drupal itself so I can set a timeout for HTTP requests when using drupal_http_request(). My reason for doing this was because Last.fm seems to timeout quite often, and Drupal won't stay up on my hosting if a module times out. This is a bit unfortunate. My development on it has stalled, as it appears finding another job is itself a full-time job. I've also shifted from Drupal stuff to exploring the Zend Framework, as I want to find a decent way to develop PHP applications as properly as possible.

Brian Wood, who has written some patches and done some work on this himself, is being far more active than me in adding functionality to this module, so I've suggested he become its custodian. So attached below is the latest version of my Last.fm module, without the patch to drupal_http_request(). It's primarily here so Brian can see what I've been doing with it. Hopefully he'll be able to pull something together and release it officially.

By the way, the thing I'd like to see in Drupal is a generic way to fetch data from a service and transform it. So far, I've used/written code which does this for Flickr, Last.fm, AllConsuming and TextLinkAds in this site. Each time, the module is using different, replicated code. It would be nice to have a proper Drupal API for this kind of stuff, don't you think? Perhaps there is one already and I just don't know about it.

AttachmentSize
lastfm.zip5.68 KB