Class Artist

Description

Represents an artist and provides different methods to query artist information.

Located in /src/Artist.php (line 9)

Media
   |
   --Artist
Method Summary
static void addTags (string $artist,  $tags, Session $session)
static Artist fromSimpleXMLElement ( $xml)
static array getEvents (string $artist)
static Artist getInfo (string $artist, [string $mbid = null], [string $lang = null])
static Playlist getPlaylist (string $artist)
static array getShouts (string $artist)
static array getSimilar (string $artist, [string $limit = null])
static array getTags (string $artist, Session $session)
static array getTopAlbums (string $artist)
static array getTopFans (string $artist)
static array getTopTags (string $artist)
static array getTopTracks (string $artist)
static void removeTag (string $artist, string $tag, Session $session)
static PaginatedResult search (string $artist, [integer $limit = null], [integer $page = null])
static void share (string $artist,  $recipients, [string $message = null], Session $session)
Artist __construct (string $name, string $mbid, string $url,  $images, boolean $streamable, integer $listeners, integer $playCount,  $tags,  $similar, string $biography, float $match)
array getArtistTags ()
string getBiography ()
float getMatch ()
boolean isStreamable ()
Methods
static method addTags (line 130)

Tag an artist with one or more user supplied tags.

  • throws: Error
  • access: public
static void addTags (string $artist,  $tags, Session $session)
  • string $artist: The artist name in question. (Required)
  • array $tags: An array of user supplied tags to apply to this artist. Accepts a maximum of 10 tags. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method fromSimpleXMLElement (line 450)

Create an Artist object from a SimpleXMLElement object.

  • return: An Artist object.
  • access: public
static Artist fromSimpleXMLElement ( $xml)
  • SimpleXMLElement $xml: A SimpleXMLElement object.
static method getEvents (line 147)

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

  • return: An array of Event objects.
  • see: Event
  • throws: Error
  • access: public
static array getEvents (string $artist)
  • string $artist: The artist name in question. (Required)
static method getInfo (line 172)

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

  • return: An Artist object.
  • throws: Error
  • access: public
static Artist getInfo (string $artist, [string $mbid = null], [string $lang = null])
  • string $artist: The artist name in question. (Optional)
  • string $mbid: The MusicBrainz ID for the artist. (Optional)
  • string $lang: The language to return the biography in, expressed as an ISO 639 alpha-2 code. (Optional)
static method getPlaylist (line 433)

Get an artist playlist for streaming. INOFFICIAL.

  • return: A Playlist object.
  • see: Playlist
  • throws: Error
  • access: public
static Playlist getPlaylist (string $artist)
  • string $artist: Artist name.
static method getShouts (line 191)

Get shouts for this artist.

  • return: An array of Shout objects.
  • throws: Error
  • access: public
static array getShouts (string $artist)
  • string $artist: The artist name in question. (Required)
static method getSimilar (line 216)

Get all the artists similar to this artist.

static array getSimilar (string $artist, [string $limit = null])
  • string $artist: The artist name in question. (Required)
  • string $limit: Limit the number of similar artists returned. (Optional)
static method getTags (line 242)

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

  • return: An array of tags.
  • see: Tag
  • throws: Error
  • access: public
static array getTags (string $artist, Session $session)
  • string $artist: The artist name in question. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method getTopAlbums (line 266)

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

  • return: An array of Album objects.
  • see: Album
  • throws: Error
  • access: public
static array getTopAlbums (string $artist)
  • string $artist: The artist name in question. (Required)
static method getTopFans (line 290)

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

  • return: An array of User objects.
  • see: User
  • throws: Error
  • access: public
static array getTopFans (string $artist)
  • string $artist: The artist name in question. (Required)
static method getTopTags (line 314)

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

  • return: An array of Tag objects.
  • see: Tag
  • throws: Error
  • access: public
static array getTopTags (string $artist)
  • string $artist: The artist name in question. (Required)
static method getTopTracks (line 338)

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

  • return: An array of Track objects.
  • see: Track
  • throws: Error
  • access: public
static array getTopTracks (string $artist)
  • string $artist: The artist name in question. (Required)
static method removeTag (line 362)

Remove a user's tag from an artist.

  • throws: Error
  • access: public
static void removeTag (string $artist, string $tag, Session $session)
  • string $artist: The artist name in question. (Required)
  • string $tag: A single user tag to remove from this artist. (Required)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
static method search (line 381)

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

  • return: A PaginatedResult object.
  • see: PaginatedResult
  • throws: Error
  • access: public
static PaginatedResult search (string $artist, [integer $limit = null], [integer $page = null])
  • string $artist: The artist name in question. (Required)
  • integer $limit: Limit the number of artists returned at one time. Default (maximum) is 30. (Optional)
  • integer $page: Scan into the results by specifying a page number. Defaults to first page. (Optional)
static method share (line 415)

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

  • throws: Error
  • access: public
static void share (string $artist,  $recipients, [string $message = null], Session $session)
  • string $artist: The artist to share. (Required)
  • array $recipients: An array email addresses or last.fm usernames. Maximum is 10. (Required)
  • string $message: An optional message to send with the recommendation. If not supplied a default message will be used. (Optional)
  • Session $session: A session obtained by getSession or getMobileSession. (Required)
Constructor __construct (line 61)

Create an Artist object.

  • access: public
Artist __construct (string $name, string $mbid, string $url,  $images, boolean $streamable, integer $listeners, integer $playCount,  $tags,  $similar, string $biography, float $match)
  • string $name: Name of this artist.
  • string $mbid: MusicBrainz ID of this artist.
  • string $url: Last.fm URL of this artist.
  • array $images: An array of cover art images of different sizes.
  • boolean $streamable: Is this artist streamable?
  • integer $listeners: Number of listeners of this artist.
  • integer $playCount: Play count of this artist.
  • array $tags: An array of tags of this artist.
  • array $similar: An array of similar artists.
  • string $biography: Biography of this artist.
  • float $match: Similarity value.

Redefinition of:
Media::__construct()
Create a media object.
getArtistTags (line 98)

Returns artist tags.

  • return: An array of Tag objects.
  • see: Tag
  • access: public
array getArtistTags ()
getBiography (line 107)

Returns the artists biography.

  • return: A biography text.
  • access: public
string getBiography ()
getMatch (line 116)

Returns similarity value.

  • return: A floating-point value from 0.0 to 1.0.
  • access: public
float getMatch ()
getSimilarArtists (line 88)

Returns similar artists.

array getSimilarArtists ()
isStreamable (line 78)

Returns if this artists is streamable.

  • return: true if this artist is streamable, otherwise false.
  • access: public
boolean isStreamable ()

Inherited Methods

Inherited From Media

Media::__construct()
Media::getImage()
Media::getListeners()
Media::getMbid()
Media::getName()
Media::getPlayCount()
Media::getUrl()
Class Constants

Documentation generated on Mon, 22 Dec 2008 16:57:30 +0100 by phpDocumentor 1.4.1