Class: Shortwave::Facade::Artist

Inherits:
Remote
  • Object
show all
Defined in:
lib/shortwave/facade/lastfm.rb

Instance Attribute Summary

Attributes inherited from Remote

#session

Instance Method Summary collapse

Methods inherited from Remote

#initialize

Constructor Details

This class inherits a constructor from Shortwave::Facade::Remote

Instance Method Details

#add_tags(artist, tags) ⇒ Object

Tag an artist with one or more user supplied tags.

artist

The artist name in question.

tags

A comma delimited list of user supplied tags to apply to this artist. Accepts a maximum of 10 tags.



642
643
644
# File 'lib/shortwave/facade/lastfm.rb', line 642

def add_tags(artist, tags)
  post(:session, {:method => "artist.addTags", :artist => artist, :tags => tags})
end

#events(artist) ⇒ Object

Get a list of upcoming events for this artist. Easily integratable into calendars, using the ical standard (see feeds section below).

artist

The artist name in question



649
650
651
# File 'lib/shortwave/facade/lastfm.rb', line 649

def events(artist)
  get(:standard, {:method => "artist.getEvents", :artist => artist})
end

#images(artist, options = {}) ⇒ Object

Get Images for this artist in a variety of sizes.

artist

The artist name in question.

Options

page

Which page of limit amount to display.

limit

How many to return. Defaults and maxes out at 50.

order

Sort ordering can be either ‘popularity’ (default) or ‘dateadded’. While ordering by popularity officially selected images by labels and artists will be ordered first. This is ignored and set to ‘dateadded’ when requested as rss.



716
717
718
# File 'lib/shortwave/facade/lastfm.rb', line 716

def images(artist, options={})
  get(:standard, {:method => "artist.getImages", :artist => artist}.merge(options))
end

#info(options = {}) ⇒ Object

Get the metadata for an artist on Last.fm. Includes biography.

Options

artist

The artist name in question

mbid

The musicbrainz id for the artist

lang

The language to return the biography in, expressed as an ISO 639 alpha-2 code.



733
734
735
# File 'lib/shortwave/facade/lastfm.rb', line 733

def info(options={})
  get(:standard, {:method => "artist.getInfo"}.merge(options))
end

#remove_tag(artist, tag) ⇒ Object

Remove a user’s tag from an artist.

artist

The artist name in question.

tag

A single user tag to remove from this artist.



693
694
695
# File 'lib/shortwave/facade/lastfm.rb', line 693

def remove_tag(artist, tag)
  post(:session, {:method => "artist.removeTag", :artist => artist, :tag => tag})
end

#search(artist, options = {}) ⇒ Object

Search for an artist by name. Returns artist matches sorted by relevance.

artist

The artist name in question.

Options

limit

Limit the number of artists returned at one time. Default (maximum) is 30.

page

Scan into the results by specifying a page number. Defaults to first page.



704
705
706
# File 'lib/shortwave/facade/lastfm.rb', line 704

def search(artist, options={})
  get(:standard, {:method => "artist.search", :artist => artist}.merge(options))
end

#share(artist, recipient, options = {}) ⇒ Object

Share an artist with Last.fm users or other friends.

artist

The artist to share.

recipient

Email Address | Last.fm Username - A comma delimited list of email addresses or Last.fm usernames. Maximum is 10.

Options

message

An optional message to send with the recommendation. If not supplied a default message will be used.



668
669
670
# File 'lib/shortwave/facade/lastfm.rb', line 668

def share(artist, recipient, options={})
  post(:session, {:method => "artist.share", :artist => artist, :recipient => recipient}.merge(options))
end

#shout(artist, message) ⇒ Object

Shout in this artist’s shoutbox

artist

The name of the artist to shout on.

message

The message to post to the shoutbox.



657
658
659
# File 'lib/shortwave/facade/lastfm.rb', line 657

def shout(artist, message)
  post(:session, {:method => "artist.shout", :artist => artist, :message => message})
end

#shouts(artist) ⇒ Object

Get shouts for this artist. Also available as an rss feed.

artist

The artist name in question.



740
741
742
# File 'lib/shortwave/facade/lastfm.rb', line 740

def shouts(artist)
  get(:standard, {:method => "artist.getShouts", :artist => artist})
end

#similar(artist, options = {}) ⇒ Object

Get all the artists similar to this artist

artist

The artist name in question

Options

limit

Limit the number of similar artists returned



685
686
687
# File 'lib/shortwave/facade/lastfm.rb', line 685

def similar(artist, options={})
  get(:standard, {:method => "artist.getSimilar", :artist => artist}.merge(options))
end

#tags(artist) ⇒ Object

Get the tags applied by an individual user to an artist on Last.fm.

artist

The artist name in question



747
748
749
# File 'lib/shortwave/facade/lastfm.rb', line 747

def tags(artist)
  get(:session, {:method => "artist.getTags", :artist => artist})
end

#top_albums(artist) ⇒ Object

Get the top albums for an artist on Last.fm, ordered by popularity.

artist

The artist name in question



754
755
756
# File 'lib/shortwave/facade/lastfm.rb', line 754

def top_albums(artist)
  get(:standard, {:method => "artist.getTopAlbums", :artist => artist})
end

#top_fans(artist) ⇒ Object

Get the top fans for an artist on Last.fm, based on listening data.

artist

The artist name in question



761
762
763
# File 'lib/shortwave/facade/lastfm.rb', line 761

def top_fans(artist)
  get(:standard, {:method => "artist.getTopFans", :artist => artist})
end

#top_tags(artist) ⇒ Object

Get the top tags for an artist on Last.fm, ordered by popularity.

artist

The artist name in question



723
724
725
# File 'lib/shortwave/facade/lastfm.rb', line 723

def top_tags(artist)
  get(:standard, {:method => "artist.getTopTags", :artist => artist})
end

#top_tracks(artist) ⇒ Object

Get the top tracks by an artist on Last.fm, ordered by popularity

artist

The artist name in question



675
676
677
# File 'lib/shortwave/facade/lastfm.rb', line 675

def top_tracks(artist)
  get(:standard, {:method => "artist.getTopTracks", :artist => artist})
end