0

I'm looking to display the total number of tracks I have scrobbled over the last month through my last.fm profile. I don't require the artists name, the track, etc, just the number of tracks played. Anyone have any idea how to accomplish this?

Thanks alot!

Martin
  • 55
  • 1
  • 9

1 Answers1

1

Last.fm exposes a public API, so you should start by reading the documentation on how to get a key and use the API: http://www.last.fm/api There is at least one javascript library out there for the last.fm api, which is good to use as it will cache for you.

Within the API you'll find the user.getWeeklyChartList method, which can be used to pull unix timestamp dates of weekly 'charts'. You can then pass the four most recent date ranges to the user.getWeeklyArtistChart api method, which will return to you lists of every artist you've listened to during that week, and each artist's gross playcount. Loop through each artist for each week, add the totals for all four weeks, and you have your monthly playcount!

Adrien Delessert
  • 1,360
  • 12
  • 17