Last.fm API integration

Events happening in the community are now at Drupal community events on www.drupal.org.
gdd's picture

Moved to official ideas list at http://drupal.org/node/236600

I propose an integration with the APIs for the music social networking site last.fm. The list of their available functionality is here:

http://www.audioscrobbler.net/data/webservices/

There are two loose classes of data. Music data (artist/album/track/tag) and profile information (my last tracks played, my most popular artists, etc.) I'd love to see both groups get implemented but either would be really useful. The former is probably a bit easier since it doesn't deal with the authentication process. One particularly interesting set of data is the concert listings for a musician, as well as the concerts users are attending (and recommendations for concerts they would like.) This could get mashed up in all sorts of cool ways.

I would think that with all the record label/band and social networking sites going up, this integration could prove to be very popular.

In doing some research there appears to be no official module for this (although there are a lot of one-off mentions of implementing the widgets and charts.) Someone had written a module, but it was never put into contrib and it is very limited:

http://townx.org/blog/elliot/drupal-last-fm-module-now-works-drupal-5

Could work as a starting point.

I'm really interested in seeing a module that is just a fully drupalized interface to their available services, which others could build widgets or blocks or anything else off of. Once that is done, 3-4 modules would be built which surface this data in interesting ways. I'd like to see what the student can come up with for integrations of the data based on what they are excited about and interested in. Here are some ideas:

  • Themable charts - These should support whatever sets of data you might put together. Right now, the only way to surface last.fm on websites is through their widgets, which you can copy and paste into your code. Making those theme-aware, as well as the ability to build charts on-the-fly, would be great.
  • Integration with Events module - Import of last.fm events into Events module for use with Calendar and Signup.
  • Mapping of Events - Plotting groups of events on Google Maps
  • Profile/Buddylist integration - Ability to add your last.fm username into your profile, so your own data can be pulled and displayed or melded with that of other users, for instance those in your Buddylist. (Note I am less familiar with this aspect of Drupal so if this is a minefield someone let me know.) Last.fm's API also has a recommendations engine, which can take groups of usernames and make recommendations. This would be cool to surface.

I would gleefully mentor this project. I'm very passionate about last.fm, I think they are awesome. Like Drupal!

Difficulty: Medium

Comments

interesting idea

ezra-g's picture

Interesting idea!

"This could get mashed up in all sorts of cool ways."

Can you expand on what you'd like to see this module do with the Last.fm API information?

One question I have would be

ezra-g's picture

One question I have would be the extent to which data from last.fm should be stored in Drupal. Should my upcoming concerts merely be represented in a block on my user page, cached and refreshed on a cron run? Should the feed information be parsable in an intelligent way, and if so should Drupal create 'event' nodes?

It's a module about nothing

gdd's picture

My idea is that this module wouldn't "do" anything. It would just provide an interface to all of last.fm's functionality. Then anyone can grab this module and build whatever they want on top of it. This way everyone who wants to write last.fm functionality doesn't have to reinvent the wheel just because their module wants to create nodes, whereas the other last.fm module doesn't but it does want to provide blocks... etc. I picture just having lots of functions like this:

function lastfm_get_events($band) {
  // call web service and get events
  // structure them into an array
  // maybe geocode them

  return $events;
}

and then some configuration options and maybe a couple modules as demos. This module just provides data, do with it what you wish. I'd love to see all the API modules approached this way.

In terms of what you could do with it, how about...

  • I'm in a band and I can plot my tour dates on a Google Map with popups for details (many bands enter their own dates on last.fm anyways so why manage them separately?.)
  • I run a record label and I can create a view with arguments that will do this for all my bands.
  • I could create a new input filter tag <band>, hovering over it would popup the band's bio or discography or...
  • I want to create a chart showing what bands are most popular with everyone in my buddylist, or songs, or albums, or...
  • all charts, now drupal themable!

This is just what I thought of sitting here for five minutes, I could probably go on all day.

Last.fm provides an API,

greggles's picture

Last.fm provides an API, right? So the current proposal is an API for an API.

I think the proposal would be much stronger if you specified maybe 4 additional user visible things that would be implemented as part of this project. That way we can have a better sense of what will be done, it provides immediate value to site builders, and people have a few examples to base future work on.

--
Open Prediction Markets | Drupal Dashboard

I agree, and there should be

gdd's picture

I agree, and there should be plenty of time to implement the functionality and do some modules that surface it in interesting ways. I would really like to work with the student for some of that, to see what cool ideas they come up with and are excited about. However, doing themable charts with whatever sets of data you might like seems like a slam dunk. Right now, the only way to surface last.fm on websites is through their widgets, which you can copy and paste into your code. Making those theme-aware, as well as the ability to build charts on-the-fly, would be great. So that is one thing I will add to the proposal.

Thanks for the feedback

"I would really like to work

ezra-g's picture

"I would really like to work with the student for some of that, to see what cool ideas they come up with and are excited about."

I think that this would be a more successful proposal if more of those ideas were fleshed out prior to being assigned to a particular student.

I have added five ideas to

gdd's picture

I have added four ideas to the proposal, and I think they're pretty strong and hit a variety of angles (new blocks/widgets, social networking, event management, etc.) Let me know what you think.

Another way of putting it

ezra-g's picture

What value should this module provide that is not already provided by the last.fm embedable widgets?

Interested

Casey D's picture

I use Last.fm not only to display "recent tracks" and "top artists" widgets on my webpages, but also to upload my own music for friends to download and listen to. Last.fm allows artists to upload as much as they want, and allows users to listen and download without registration, so it's a potentially powerful promotional tool. The artist pages themselves, however, leave a lot to be desired. Being able to serve Last.fm content on a themed Drupal site would be ideal.

It would also be a lot of fun for Last.fm users who would like to display only the charts and information they care about on their own sites with their own layout. Any Drupal user with a Last.fm account would love to use this, if just for something trivial like the ability to automatically display what they're "now listening to" as they post a blog.

I'd love to adopt this project for SoC. I haven't looked at that module (yet) but I'm looking at the API and I think I could lay out the groundwork relatively quickly, leaving plenty of time for testing, bug fixing, and developing a UI. Since you're offering to mentor this, heyrocker, just let me know what you need from your prospective student and what we can do to get this idea off the ground.

Casey

Thanks for your interest! I

gdd's picture

Thanks for your interest! I look forward to seeing your application.

Grate idea

AlexEvt's picture

This module will be very useful for individual sites and blogs.
I agree and interested as a student too.

Think positive!!!

Good to see this

gusaus's picture

Might have been early game, but I've been loving the idea of Last.fm integration for a long time. So far, I've been haphazardly cutting/pasting various widgets into a test site:
http://pepperalley.com/new/media/playlists
http://pepperalley.com/new/radio

Do they have an open API - hell yes - check out some of cool things that people are creating:
http://blog.programmableweb.com/2007/11/27/36-lastfm-mashups/

I think a great first step would be to offer up the Last.fm player as part of the excellent embedded media field:
http://drupal.org/project/emfield - http://drupalhub.org/en/audio

Maybe we could make a workshop out of integrating Last.fm and some other fine services that are artist and fan friendly.

Gus Austin
PepperAlley Productions

Gus Austin

last.fm and emfield

aaron's picture

last.fm videos are already supported in embedded media field. i never got around to adding last.fm as audio, although there was a task suggesting this for ghop. i'd definitely be interested in helping mentor this project, as it's already planned for emfield, regardless of what happens here.

Aaron Winborn
Advomatic, Web Design for Progressive Advocacy, Grassroots Movements, and Really Cool Causes

Aaron Winborn
Drupal Multimedia (my book, available now!)
AaronWinborn.com
Advomatic

My proposal is really about

gdd's picture

My proposal is really about the data more than it is about the audio/video. However if a student had some cool ideas for usage of the players I'd be all for it.

DROP task submitted

gusaus's picture

I found the prev GHOP task and amended -
http://drop.cwgordon.com/node/96

Additional audio support would have a ton of value to the project and community. I'm down for testing, promoting, and 'ideally' integrating into projects like a Drupal band profile.

Gus Austin
PepperAlley Productions

Gus Austin

Great idea

balleyne's picture

Wow, as a musician, last.fm user, web developer and prospective GSoC student, you've caught my attention! I'll be looking into this further!

Feel free to post if you

gdd's picture

Feel free to post if you have any questions or ideas.

I think this is going to be a great Project

fyaconiello's picture

I'm considering putting an application in for this project, I just have a few reservations. Last.fm does not have an API yet. They have feeds that supply data, but those will be deprecated soon by a fully featured API. When I asked in #audioscrobbler,

fyaconiello-   max: is there a list of last.fm endpoints and the key value pairs that those endpoints are expecting?
russ-           we have no real documented api
russ-           at the moment
russ-           we have the feeds.
jonty-          but it's actually almost complete, so don't worry
fyaconiello-   Whats the ETA, Google's SOC projects start on May 26, will there be an API in operation at that time?
jonty-          Can't really say I'm afraid
fyaconiello-   I guess I'll just have to pop in here and ask every once in a while. Thanks for your help, and good luck. =)

What are your thoughts - is it worthwhile to submit a proposal for the drupal module for last.fm, knowing that the last.fm API is incomplete now and possibly will not be done by the start of the GSOC program?

  • Francis
  • Francis

API

gdd's picture

Hi Francis, sorry I missed you on IRC last night.

There is actually a pretty full-featured set of web services available now. They are listed at

http://www.audioscrobbler.net/data/webservices/

This is what I had envisioned using as the basis of the module. If the API is incomplete then I think it is perfectly fine building the module since it can be expanded later. However, if the APIs are going to be deprecated and replaced, then yes this probably isn't an appropriate task to be doing at this time. I had not heard of that possibility before.

I'm going to try and dig up some more information and post back here asap.

No telling

fyaconiello's picture

thanks for responding, heyrocker. hopefully, I'll catch you in the IRC channel tonight.

As far as I can tell on the build.last.fm site, theres no telling when the new API will come online or when the current feed based system will be taken offline. In the mean time i think the community could benefit from a drupalized approach to consuming last.fm's data.

Though, whoever gets to work on this proposal (hopefully myself), should probably task themselves with putting out a new version of the modules when the first major version of the last.fm API is released.

  • Francis
  • Francis

Submitted my proposal

fyaconiello's picture

I've put up a first draft of my proposal. if you get a chance, check it out and let me know what you guys think.

http://yaconiello.com/gsoc-2008-application

  • Francis
  • Francis

XSPF Playlists

gusaus's picture

Many XSPF lists are offered up as part of the webservices (http://www.audioscrobbler.net/data/webservices/). Not exactly sure how you'd be able to play audio on a Drupal site without embedding the Last.fm widget. Assume there's a way, in theory, to access an external library?

Gus Austin
PepperAlley Productions

Gus Austin

Local music scene website

Thrash35's picture

I signed up to this forum to post on this thread.

I run a local music website in Scotland called livims.co.uk. It runs on Joomla at the moment but may be convinced to convert to Drupal if some of the idea's on this thread get written. (Or maybe Joomla developers will be inspired by it).

My site has the usual gig calendar, forum and band pages, but the way it all works is quite unintuitive and cobbled together. I love how last.fm handles events, venues and bands and how they are all integrated and slick. I would love to integrate a lot of these last.fm features in my website while keeping it under a CMS umbrella so I can keep control of the look and feel.

Good luck with your extension. I may help testing and develop ideas when I get some spare time.

Regards,
Kev

Several places to look at...

Updates

eddowding's picture

Hi
Did anything come of this? I'm looking to use it on a gig website and would love to hear from anyone who might be able to help.
Ed

Music

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: