Package de.umass.lastfm
Class Artist
java.lang.Object
de.umass.lastfm.ImageHolder
de.umass.lastfm.MusicEntry
de.umass.lastfm.Artist
Bean that contains artist information.
This class contains static methods that executes API methods relating to artists.
Method names are equivalent to the last.fm API method names.
This class contains static methods that executes API methods relating to artists.
Method names are equivalent to the last.fm API method names.
- Author:
- Janni Kovacs
-
Field Summary
Fields inherited from class de.umass.lastfm.MusicEntry
id, listeners, mbid, name, percentageChange, playcount, streamable, tags, url, userPlaycount
Fields inherited from class de.umass.lastfm.ImageHolder
imageUrls
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Result
Tag an artist with one or more user supplied tags.static Artist
getCorrection
(String artist, String apiKey) Use the last.fm corrections data to check whether the supplied artist has a correction to a canonical artist.static Collection<Event>
Returns a list of upcoming events for an artist.static PaginatedResult<Image>
GetImage
s for this artist in a variety of sizes.static PaginatedResult<Image>
GetImage
s for this artist in a variety of sizes.static Artist
Retrieves detailed artist info for the given artist or mbid entry.static Artist
Retrieves detailed artist info for the given artist or mbid entry.static Artist
Retrieves detailed artist info for the given artist or mbid entry.static PaginatedResult<Event>
getPastEvents
(String artist, int page, int limit, String apiKey) Get a paginated list of all the events this artist has played at in the past.static PaginatedResult<Event>
getPastEvents
(String artist, String apiKey) Get a paginated list of all the events this artist has played at in the past.Returns a list of similarArtist
s.static Collection<Artist>
getSimilar
(String artist, int limit, String apiKey) Returnslimit
similar artists to the given one.static Collection<Artist>
getSimilar
(String artist, String apiKey) CallsgetSimilar(String, int, String)
with the default limit of 100.float
static Collection<String>
Get the tags applied by an individual user to an artist on Last.fm.static Collection<Album>
getTopAlbums
(String artist, String apiKey) Returns a list of the given artist's top albums.static Collection<User>
getTopFans
(String artist, String apiKey) Retrieves a list of the top fans of the given artist.static Collection<Tag>
getTopTags
(String artist, String apiKey) Retrieves the top tags for the given artist.static Collection<Track>
getTopTracks
(String artist, String apiKey) Get the top tracks by an artist on Last.fm, ordered by popularitystatic Result
Remove a user's tag from an artist.static Collection<Artist>
Searches for an artist and returns aCollection
of possible matches.static Result
Share an artist with one or more Last.fm users or other friends.static Result
Shout on this artist's shoutboxMethods inherited from class de.umass.lastfm.MusicEntry
getId, getListeners, getMbid, getName, getPercentageChange, getPlaycount, getTags, getUrl, getUserPlaycount, getWikiLastChanged, getWikiSummary, getWikiText, isStreamable, loadStandardInfo
Methods inherited from class de.umass.lastfm.ImageHolder
availableSizes, getImageURL, loadImages
-
Constructor Details
-
Artist
-
Artist
-
-
Method Details
-
getSimilarityMatch
public float getSimilarityMatch() -
getSimilar
Returns a list of similarArtist
s. Note that this method does not retrieve this list from the server but instead returns the result of anartist.getInfo
call.
If you need to retrieve similar artists to a specified artist use thegetSimilar(String, String)
method.- Returns:
- list of similar artists
- See Also:
-
getInfo
Retrieves detailed artist info for the given artist or mbid entry.- Parameters:
artistOrMbid
- Name of the artist or an mbidapiKey
- The API key- Returns:
- detailed artist info
-
getInfo
Retrieves detailed artist info for the given artist or mbid entry.- Parameters:
artistOrMbid
- Name of the artist or an mbidusername
- The username for the context of the request, ornull
. If supplied, the user's playcount for this artist is included in the responseapiKey
- The API key- Returns:
- detailed artist info
-
getInfo
Retrieves detailed artist info for the given artist or mbid entry.- Parameters:
artistOrMbid
- Name of the artist or an mbidlocale
- The language to fetch info in, ornull
username
- The username for the context of the request, ornull
. If supplied, the user's playcount for this artist is included in the responseapiKey
- The API key- Returns:
- detailed artist info
-
getSimilar
CallsgetSimilar(String, int, String)
with the default limit of 100.- Parameters:
artist
- Artist's nameapiKey
- The API key- Returns:
- similar artists
- See Also:
-
getSimilar
Returnslimit
similar artists to the given one.- Parameters:
artist
- Artist's namelimit
- Number of maximum resultsapiKey
- The API key- Returns:
- similar artists
-
search
Searches for an artist and returns aCollection
of possible matches.- Parameters:
name
- The artist name to look upapiKey
- The API key- Returns:
- a list of possible matches
-
getTopAlbums
Returns a list of the given artist's top albums.- Parameters:
artist
- Artist's nameapiKey
- The API key- Returns:
- list of top albums
-
getTopFans
Retrieves a list of the top fans of the given artist.- Parameters:
artist
- Artist's nameapiKey
- The API key- Returns:
- list of top fans
-
getTopTags
Retrieves the top tags for the given artist.- Parameters:
artist
- Artist's nameapiKey
- The API key- Returns:
- list of top tags
-
getTopTracks
Get the top tracks by an artist on Last.fm, ordered by popularity- Parameters:
artist
- The artist name in questionapiKey
- A Last.fm API key.- Returns:
- list of top tracks
-
addTags
Tag an artist with one or more user supplied tags.- Parameters:
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.session
- A Session instance- Returns:
- the result of the operation
-
removeTag
Remove a user's tag from an artist.- Parameters:
artist
- The artist name in question.tag
- A single user tag to remove from this artist.session
- A Session instance- Returns:
- the result of the operation
-
getTags
Get the tags applied by an individual user to an artist on Last.fm.- Parameters:
artist
- The artist name in questionsession
- A Session instance- Returns:
- a list of tags
-
getEvents
Returns a list of upcoming events for an artist.- Parameters:
artist
- The artist name in questionapiKey
- A Last.fm API key.- Returns:
- a list of events
-
getPastEvents
Get a paginated list of all the events this artist has played at in the past.- Parameters:
artist
- The name of the artist you would like to fetch event listings forapiKey
- A Last.fm API key- Returns:
- a list of past events
-
getPastEvents
public static PaginatedResult<Event> getPastEvents(String artist, int page, int limit, String apiKey) Get a paginated list of all the events this artist has played at in the past.- Parameters:
artist
- The name of the artist you would like to fetch event listings forpage
- The page of results to returnlimit
- The maximum number of results to return per pageapiKey
- A Last.fm API key- Returns:
- a list of past events
-
getImages
GetImage
s for this artist in a variety of sizes.- Parameters:
artist
- The artist name in questionapiKey
- A Last.fm API key- Returns:
- a list of
Image
s
-
getImages
GetImage
s for this artist in a variety of sizes.- Parameters:
artist
- The artist name in questionpage
- Which page of limit amount to displaylimit
- How many to return. Defaults and maxes out at 50apiKey
- A Last.fm API key- Returns:
- a list of
Image
s
-
shout
Shout on this artist's shoutbox- Parameters:
artist
- The name of the artist to shout onmessage
- The message to post to the shoutboxsession
- A Session instance- Returns:
- the result of the operation
-
getCorrection
Use the last.fm corrections data to check whether the supplied artist has a correction to a canonical artist. This method returns a newArtist
object containing the corrected data, ornull
if the supplied Artist was not found.- Parameters:
artist
- The artist name to correctapiKey
- A Last.fm API key- Returns:
- a new
Artist
, ornull
-