Brian Sorahan
and 1 contributors

NAME

WWW::EchoNest::Playlist - A Dynamic Playlist Object.

SYNOPSIS

  The Playlist module loosely covers L< http://developer.echonest.com/docs/v4/playlist.html >.
  Refer to the official api documentation if you are unsure about something.

METHODS

new

  Returns a new WWW::EchoNest::Playlist instance.

  NOTE:
    WWW::EchoNest also provides a get_playlist() convenience function that also returns a new WWW::EchoNest::Playlist instance.

  ARGUMENTS:
    type => a string representing the playlist type -- ('artist', 'artist-radio', 'artist-description', 'song-radio')
    artist_pick => How songs should be chosen for each artist
    variety => A number between 0 and 1 specifying the variety of the playlist
    artist_id => the artist_id
    artist => the name of an artist
    song_id => the song_id
    description => A string describing the artist and song
    style => A string describing the style/genre of the artist and song
    mood => A string describing the mood of the artist and song
    results => An integer number of results to return
    max_tempo => The max tempo of song results
    min_tempo => The min tempo of song results
    max_duration => The max duration of song results
    min_duration => The min duration of song results
    max_loudness => The max loudness of song results
    min_loudness => The min loudness of song results
    artist_max_familiarity => A float specifying the max familiarity of artists to search for
    artist_min_familiarity => A float specifying the min familiarity of artists to search for
    artist_max_hotttnesss => A float specifying the max hotttnesss of artists to search for
    artist_min_hotttnesss => A float specifying the max hotttnesss of artists to search for
    song_max_hotttnesss => A float specifying the max hotttnesss of songs to search for
    song_min_hotttnesss => A float specifying the max hotttnesss of songs to search for
    max_energy => The max energy of song results
    min_energy => The min energy of song results
    max_dancibility => The max dancibility of song results
    min_dancibility => The min dancibility of song results
    mode => 0 or 1 (minor or major)
    key => 0-11 (c, c-sharp, d, e-flat, e, f, f-sharp, g, a-flat, a, b-flat, b)
    max_latitude => A float specifying the max latitude of artists to search for
    min_latitude => A float specifying the min latitude of artists to search for
    max_longitude => A float specifying the max longitude of artists to search for
    min_longitude => A float specifying the min longitude of artists to search for
    sort => A string indicating an attribute and order for sorting the results
    buckets => A list of strings specifying which buckets to retrieve
    limit => A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets
    seed_catalog => A Catalog object or catalog id to use as a seed
    source_catalog => A Catalog object or catalog id
    steer => A steering value to determine the target song attributes
    steer_description => A steering value to determine the target song description term attributes
    rank_type => A string denoting the desired ranking for description searches, either 'relevance' or 'familiarity'



  RETURNS:
    A new instance of WWW::EchoNest::Playlist.

  EXAMPLE:
    use WWW::EchoNest qw( :all );
    use WWW::EchoNest::Playlist;
    my $playlist = get_playlist( { type => 'artist-radio', artist => [ 'The Beatles', 'The Rolling Stones', ], } );
    

get_next_song

  Get the next song in the playlist.

  ARGUMENTS:
    none

  RETURNS:
    A WWW::EchoNest::Song instance.

  EXAMPLE:
    my $next_song = $playlist->get_next_song();

get_current_song

  Get the current song in the playlist.

  ARGUMENTS:
    none

  RETURNS:
    A WWW::EchoNest::Song instance.

  EXAMPLE:
    my $curr_song = $playlist->get_current_song();

session_info

  Get information about the playlist.

  ARGUMENTS:
    none

  RETURNS:
    A reference to a hash that contains diagnostic information
    about the currently running playlist.

  EXAMPLE:
    my $playlist_info = $playlist->session_info();

FUNCTIONS

static

  Get a static playlist.

  ARGUMENTS:
    type => a string representing the playlist type ('artist', 'artist-radio', ...)
    artist_pick => How songs should be chosen for each artist
    variety => A number between 0 and 1 specifying the variety of the playlist
    artist_id => the artist_id
    artist => the name of an artist
    song_id => the song_id
    description => A string describing the artist and song
    style => A string describing the style/genre of the artist and song
    mood => A string describing the mood of the artist and song
    results => An integer number of results to return
    max_tempo => The max tempo of song results
    min_tempo => The min tempo of song results
    max_duration => The max duration of song results
    min_duration => The min duration of song results
    max_loudness => The max loudness of song results
    min_loudness => The min loudness of song results
    artist_max_familiarity => A float specifying the max familiarity of artists to search for
    artist_min_familiarity => A float specifying the min familiarity of artists to search for
    artist_max_hotttnesss => A float specifying the max hotttnesss of artists to search for
    artist_min_hotttnesss => A float specifying the max hotttnesss of artists to search for
    song_max_hotttnesss => A float specifying the max hotttnesss of songs to search for
    song_min_hotttnesss => A float specifying the max hotttnesss of songs to search for
    max_energy => The max energy of song results
    min_energy => The min energy of song results
    max_dancibility => The max dancibility of song results
    min_dancibility => The min dancibility of song results
    mode => 0 or 1 (minor or major)
    key => 0-11 (c, c-sharp, d, e-flat, e, f, f-sharp, g, a-flat, a, b-flat, b)
    max_latitude => A float specifying the max latitude of artists to search for
    min_latitude => A float specifying the min latitude of artists to search for
    max_longitude => A float specifying the max longitude of artists to search for
    min_longitude => A float specifying the min longitude of artists to search for                        
    sort => A string indicating an attribute and order for sorting the results
    buckets => A list of strings specifying which buckets to retrieve
    limit => A boolean indicating whether or not to limit the results to one of the id spaces specified in buckets
    seed_catalog => A Catalog object or catalog id to use as a seed
    source_catalog => A Catalog object or catalog id
    rank_type => A string denoting the desired ranking for description searches, either 'relevance' or 'familiarity'



  RETURNS:
    A reference to a hash that contains diagnostic information about the currently running playlist.

  EXAMPLE:
    use WWW::EchoNest::Playlist qw( static );
    my $static_playlist = static( { type => 'artist-radio', artist => [ 'The Beatles', 'The Rolling Stones', ], } );

AUTHOR

Brian Sorahan, <bsorahan@gmail.com>

SUPPORT

Join the Google group: <http://groups.google.com/group/www-echonest>

ACKNOWLEDGEMENTS

Thanks to all the folks at The Echo Nest for providing access to their powerful API.

LICENSE

Copyright 2011 Brian Sorahan.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.