API & Project
Mike Harmala
Jeremy Canfield
Yuliang Ma
Last.fm is a way for you to track your
listening habits. Each track reported to
Last.fm is called a scrobble.
Last.fm is also a social network that
aggregates users' data & recommends
new music based on users' habits
That's a lot of data! Last.fm has an API
for developers to use

         last.fm/api
The API lets you see things at an
individual user level or an aggregate
level. Things like...
an artist's tags     a user's top artists




event info
Before getting an API key, you need to
make a user profile (do it!)
After applying for an API account, you
get an API key & a secret code that
authenticates you for write services
For the API you call a method & it will
return XML, like this for track.getInfo
parameters
artist artist name in question (optional)
track track name in question (optional
mbid musicbrainz id for the track (optional)
username username for the context of the request. If supplied, the user's
playcount for this track and whether they have loved the track is included
in the response (optional)
api_key A Last.fm API key (required!)

url input (we'll just use api_key, track & artist)
http://ws.audioscrobbler.com/2.0/?
method=track.getinfo&api_key=b25b959554ed76058ac220b7b2e0a
026&artist=radiohead&track=paranoid+android
Part of Dumper() could look like...
'toptags' => {
         'tag' => {
              'alternative rock' => {
                                 'url' => 'http://www.last.fm/tag/alternative%20rock'
                               },
              'indie' => {
                       'url' => 'http://www.last.fm/tag/indie'
                     },
              'rock' => {
                      'url' => 'http://www.last.fm/tag/rock'
                    },
              'alternative' => {
                             'url' => 'http://www.last.fm/tag/alternative'
                           },
              'radiohead' => {
                           'url' => 'http://www.last.fm/tag/radiohead'
                         }
            }
         },
'name' => 'Paranoid Android',
'duration' => '382000',
'mbid' => {},
'album' => {
       'artist' => 'Radiohead',
       'url' => 'http://www.last.fm/music/Radiohead/OK+Computer',
       'position' => '2',
       'title' => 'OK Computer',
        ...
Questions?
print "Ask a question:n";
my $question=<>;
Our Project


Tag Exploration
Project Goals
1 Compare Users based on Tags

2 Find Weird Tags for Artists
Project Goal 1
Compare Users based on Tags
a. Get a last.fm user's favorite artists, then
   compile the tags for all those artists into
   a list

b. Do the same for a second user

c. Compare tag lists
Project Goal 1
Compare Users based on Tags
wordle

tag cloud

bar chart
Project Goal 2
Find Weird Tags for Artists
a. Get a last.fm artist's similar artists, then
   compile the tags for all those artists

b. Analyze tag lists
Project Goal 2
Find Weird Tags for Artists
last.fm Tag explorer
thank you

Last fm api_overview

  • 1.
    API & Project MikeHarmala Jeremy Canfield Yuliang Ma
  • 2.
    Last.fm is away for you to track your listening habits. Each track reported to Last.fm is called a scrobble.
  • 3.
    Last.fm is alsoa social network that aggregates users' data & recommends new music based on users' habits
  • 4.
    That's a lotof data! Last.fm has an API for developers to use last.fm/api
  • 5.
    The API letsyou see things at an individual user level or an aggregate level. Things like... an artist's tags a user's top artists event info
  • 6.
    Before getting anAPI key, you need to make a user profile (do it!)
  • 7.
    After applying foran API account, you get an API key & a secret code that authenticates you for write services
  • 8.
    For the APIyou call a method & it will return XML, like this for track.getInfo parameters artist artist name in question (optional) track track name in question (optional mbid musicbrainz id for the track (optional) username username for the context of the request. If supplied, the user's playcount for this track and whether they have loved the track is included in the response (optional) api_key A Last.fm API key (required!) url input (we'll just use api_key, track & artist) http://ws.audioscrobbler.com/2.0/? method=track.getinfo&api_key=b25b959554ed76058ac220b7b2e0a 026&artist=radiohead&track=paranoid+android
  • 9.
    Part of Dumper()could look like... 'toptags' => { 'tag' => { 'alternative rock' => { 'url' => 'http://www.last.fm/tag/alternative%20rock' }, 'indie' => { 'url' => 'http://www.last.fm/tag/indie' }, 'rock' => { 'url' => 'http://www.last.fm/tag/rock' }, 'alternative' => { 'url' => 'http://www.last.fm/tag/alternative' }, 'radiohead' => { 'url' => 'http://www.last.fm/tag/radiohead' } } }, 'name' => 'Paranoid Android', 'duration' => '382000', 'mbid' => {}, 'album' => { 'artist' => 'Radiohead', 'url' => 'http://www.last.fm/music/Radiohead/OK+Computer', 'position' => '2', 'title' => 'OK Computer', ...
  • 10.
    Questions? print "Ask aquestion:n"; my $question=<>;
  • 11.
  • 12.
    Project Goals 1 CompareUsers based on Tags 2 Find Weird Tags for Artists
  • 13.
    Project Goal 1 CompareUsers based on Tags a. Get a last.fm user's favorite artists, then compile the tags for all those artists into a list b. Do the same for a second user c. Compare tag lists
  • 14.
    Project Goal 1 CompareUsers based on Tags wordle tag cloud bar chart
  • 15.
    Project Goal 2 FindWeird Tags for Artists a. Get a last.fm artist's similar artists, then compile the tags for all those artists b. Analyze tag lists
  • 16.
    Project Goal 2 FindWeird Tags for Artists last.fm Tag explorer
  • 17.