Class: Shortwave::Facade::Artist
- Defined in:
- lib/shortwave/facade/lastfm.rb
Instance Attribute Summary
Attributes inherited from Remote
Instance Method Summary collapse
-
#add_tags(artist, tags) ⇒ Object
Tag an artist with one or more user supplied tags.
-
#events(artist) ⇒ Object
Get a list of upcoming events for this artist.
-
#images(artist, options = {}) ⇒ Object
Get Images for this artist in a variety of sizes.
-
#info(options = {}) ⇒ Object
Get the metadata for an artist on Last.fm.
-
#remove_tag(artist, tag) ⇒ Object
Remove a user’s tag from an artist.
-
#search(artist, options = {}) ⇒ Object
Search for an artist by name.
-
#share(artist, recipient, options = {}) ⇒ Object
Share an artist with Last.fm users or other friends.
-
#shout(artist, message) ⇒ Object
Shout in this artist’s shoutbox.
-
#shouts(artist) ⇒ Object
Get shouts for this artist.
-
#similar(artist, options = {}) ⇒ Object
Get all the artists similar to this artist.
-
#tags(artist) ⇒ Object
Get the tags applied by an individual user to an artist on Last.fm.
-
#top_albums(artist) ⇒ Object
Get the top albums for an artist on Last.fm, ordered by popularity.
-
#top_fans(artist) ⇒ Object
Get the top fans for an artist on Last.fm, based on listening data.
-
#top_tags(artist) ⇒ Object
Get the top tags for an artist on Last.fm, ordered by popularity.
-
#top_tracks(artist) ⇒ Object
Get the top tracks by an artist on Last.fm, ordered by popularity.
Methods inherited from Remote
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 (artist, ) post(:session, {:method => "artist.addTags", :artist => artist, :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, ={}) get(:standard, {:method => "artist.getImages", :artist => artist}.merge()) 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(={}) get(:standard, {:method => "artist.getInfo"}.merge()) 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, ={}) get(:standard, {:method => "artist.search", :artist => artist}.merge()) 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, ={}) post(:session, {:method => "artist.share", :artist => artist, :recipient => recipient}.merge()) 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, ) post(:session, {:method => "artist.shout", :artist => artist, :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, ={}) get(:standard, {:method => "artist.getSimilar", :artist => artist}.merge()) 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 (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 (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 |