Module: Ronnie::Client::Artists

Included in:
Ronnie::Client
Defined in:
lib/ronnie/client/artists.rb

Instance Method Summary collapse

Instance Method Details

#find_artists_by_label(label_id, options = {}) ⇒ Object

Find Artists by Label

Examples:

Ronnie.find_artists_by_label('l2270')

Parameters:

  • label_id (String)


9
10
11
# File 'lib/ronnie/client/artists.rb', line 9

def find_artists_by_label(label_id, options={})
  post('getArtistsForLabel', { label: label_id })
end

#heavily_rotated_artists(user_id = nil, friends = nil, options = {}) ⇒ Object

retrieve heavily rotated artists.

Examples:

Ronnie.heavily_rotated_artists


26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ronnie/client/artists.rb', line 26

def heavily_rotated_artists(user_id=nil, friends=nil, options={})
  if user_id 
    required_options = { user: user_id, type: 'artists' }

    if friends
      required_options = required_options.merge!({ friends: friends })
    end
  else
    required_options = { type: 'artists' }
  end

  post('getHeavyRotation', required_options.merge!(options))
end

#search_artists(query, options = {}) ⇒ Object

Search Artists

Examples:

Ronnie.search_artists('Mount Eerie')

Parameters:

  • query (String)


18
19
20
# File 'lib/ronnie/client/artists.rb', line 18

def search_artists(query, options={})
  post('search', { query: query, types: 'Artist' })
end

#top_artists(options = {}) ⇒ Object

retrieve the site-wide most popular artists.

Examples:

Ronnie.top_artists


44
45
46
# File 'lib/ronnie/client/artists.rb', line 44

def top_artists(options={})
  post('getTopCharts', { type: "Artist" })
end