Class: LastFM::Playlist

Inherits:
Object
  • Object
show all
Defined in:
lib/lastfm/playlist.rb

Class Method Summary collapse

Class Method Details

.add_track(params) ⇒ Object

Add a track to a Last.fm user's playlist

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :playlist_id (String, required)

    the id of the playlist (see: User.get_playlists)

  • :track (String, required)

    the track name to add to the playlist

  • :artist (String, required)

    the artist that corresponds to the track to be added

See Also:


11
12
13
14
# File 'lib/lastfm/playlist.rb', line 11

def add_track( params )
  LastFM.requires_authentication
  LastFM.post( "playlist.addTrack", params )
end

.create(params) ⇒ Object

Create a Last.fm playlist on behalf of a user.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :title (String, optional)

    title for the playlist

  • :description (String, optional)

    description for the playlist

See Also:


21
22
23
24
# File 'lib/lastfm/playlist.rb', line 21

def create( params )
  LastFM.requires_authentication
  LastFM.post( "playlist.create", params )
end

.fetch(params) ⇒ Object

Deprecated.

documentation removed from last.fm/api, but method calls still work

Fetch XSPF playlists using a lastfm playlist url.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :playlist_url (String, required)

    lastfm protocol playlist url (lastfm://playlist/…)

  • :steaming (Boolean, optional)

    whether to return mp3 links for song previews

See Also:


32
33
34
# File 'lib/lastfm/playlist.rb', line 32

def fetch( params )
  LastFM.get( "playlist.fetch", params )
end