The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WebService::LastFM::Track - The Track class of WebService::LastFM

SYNOPSIS

  use WebService::LastFM;


  my $lastfm = WebService::LastFM->new(
        username => $config{username},
        password => $config{password},
  );
  my $session_key = $stream_info->session;
  my $playlist = $lastfm->get_new_playlist();
  while ( my $track = $playlist->get_next_track() ) {
      foreach ( qw/ location  creator  duration image
                    album     title    lastfm:artistId
                    lastfm:trackauth lastfm:albumId /)
      {
        print "$_: ".$track->$_."\n" if defined $track->$_;
        system( 'mpg123', $track->location() );
      }
  }

DESCRIPTION

WebService::LastFM::Track provides the Track class to WebService::LastFM

METHODS

location()
  $url = $track->location();

Returns a url ready for passing to you streaming media player. This is a one-time-use url. Repeated attempts will fail.

creator()
  $artists = $track->creator();

Returns the artist of the track.

duration()
  $duration = $track->duration();

Returns the duration of the track.

image()
  $image_url = $track->image();

Returns a url to the album image, if available.

album()
  $album_name = $track->album();

Returns the album name, if available.

title()
  $track_title = $track->title();

Returns the track's title.

SEE ALSO

AUTHOR

Christian Brink, <grep_pdx@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2008 - 2009 by Christian Brink

Copyright (C) 2005 - 2008 by Kentaro Kuribayashi

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.