Package de.umass.lastfm
Class User
java.lang.Object
de.umass.lastfm.ImageHolder
de.umass.lastfm.User
Contains user information and provides bindings to the methods in the user. namespace.
- Author:
- Janni Kovacs
-
Field Summary
Fields inherited from class de.umass.lastfm.ImageHolder
imageUrls
-
Method Summary
Modifier and TypeMethodDescriptionint
getAge()
static PaginatedResult<Track>
getArtistTracks
(String user, String artist, int page, long startTimestamp, long endTimestamp, String apiKey) Get a list of tracks by a given artist scrobbled by this user, including scrobble time.static PaginatedResult<Track>
getArtistTracks
(String user, String artist, String apiKey) Get a list of tracks by a given artist scrobbled by this user, including scrobble time.static PaginatedResult<Track>
getBannedTracks
(String user, int page, String apiKey) Returns the tracks banned by the user.static PaginatedResult<Track>
getBannedTracks
(String user, String apiKey) Returns the tracks banned by the user.static Collection<Event>
GetS a list of upcoming events that this user is attending.static Collection<User>
getFriends
(String user, boolean recenttracks, int limit, String apiKey) static Collection<User>
getFriends
(String user, String apiKey) getId()
static User
Retrieves profile information about the specified user.static PaginatedResult<Track>
getLovedTracks
(String user, int page, String apiKey) Retrieves the loved tracks by a user.static PaginatedResult<Track>
getLovedTracks
(String user, String apiKey) Retrieves the loved tracks by a user.getName()
static Collection<User>
getNeighbours
(String user, int limit, String apiKey) static Collection<User>
getNeighbours
(String user, String apiKey) static Collection<Album>
getNewReleases
(String user, boolean useRecommendations, String apiKey) Gets a list of forthcoming releases based on a user's musical taste.static Collection<Album>
getNewReleases
(String user, String apiKey) Gets a list of forthcoming releases based on a user's musical taste.int
static PaginatedResult<Event>
getPastEvents
(String user, int page, String apiKey) Gets a paginated list of all events a user has attended in the past.static PaginatedResult<Event>
getPastEvents
(String user, String apiKey) Get the first page of a paginated result of all events a user has attended in the past.int
static Collection<Playlist>
getPlaylists
(String user, String apiKey) Gets a list of a user's playlists on Last.fm.static PaginatedResult<Track>
getRecentTracks
(String user, int limit, String apiKey, int page) static PaginatedResult<Track>
getRecentTracks
(String user, String apiKey) static PaginatedResult<Artist>
getRecommendedArtists
(int page, Session session) Get Last.fm artist recommendations for a user.static PaginatedResult<Artist>
getRecommendedArtists
(Session session) Get Last.fm artist recommendations for a user.static PaginatedResult<Event>
getRecommendedEvents
(int page, Session session) static PaginatedResult<Event>
getRecommendedEvents
(Session session) static Collection<Album>
getTopAlbums
(String user, Period period, String apiKey) static Collection<Album>
getTopAlbums
(String user, String apiKey) static Collection<Artist>
getTopArtists
(String user, Period period, String apiKey) static Collection<Artist>
getTopArtists
(String user, String apiKey) static Collection<Tag>
getTopTags
(String user, int limit, String apiKey) static Collection<Tag>
getTopTags
(String user, String apiKey) static Collection<Track>
getTopTracks
(String user, Period period, String apiKey) static Collection<Track>
getTopTracks
(String user, String apiKey) getUrl()
getWeeklyAlbumChart
(String user, int limit, String apiKey) getWeeklyAlbumChart
(String user, String apiKey) getWeeklyAlbumChart
(String user, String from, String to, int limit, String apiKey) getWeeklyArtistChart
(String user, int limit, String apiKey) getWeeklyArtistChart
(String user, String apiKey) getWeeklyArtistChart
(String user, String from, String to, int limit, String apiKey) static LinkedHashMap<String,
String> getWeeklyChartList
(String user, String apiKey) static Collection<Chart>
getWeeklyChartListAsCharts
(String user, String apiKey) getWeeklyTrackChart
(String user, int limit, String apiKey) getWeeklyTrackChart
(String user, String apiKey) getWeeklyTrackChart
(String user, String from, String to, int limit, String apiKey) boolean
static Result
Shout on this user's shoutboxMethods inherited from class de.umass.lastfm.ImageHolder
availableSizes, getImageURL, loadImages
-
Method Details
-
getName
-
getRealname
-
getUrl
-
getAge
public int getAge() -
getCountry
-
getGender
-
getLanguage
-
getNumPlaylists
public int getNumPlaylists() -
getPlaycount
public int getPlaycount() -
isSubscriber
public boolean isSubscriber() -
getImageURL
-
getId
-
getRegisteredDate
-
getArtistTracks
Get a list of tracks by a given artist scrobbled by this user, including scrobble time. Can be limited to specific timeranges, defaults to all time.- Parameters:
user
- The last.fm username to fetch the recent tracks ofartist
- The artist name you are interested inapiKey
- A Last.fm API key- Returns:
- a list of Tracks
-
getArtistTracks
public static PaginatedResult<Track> getArtistTracks(String user, String artist, int page, long startTimestamp, long endTimestamp, String apiKey) Get a list of tracks by a given artist scrobbled by this user, including scrobble time. Can be limited to specific timeranges, defaults to all time.- Parameters:
user
- The last.fm username to fetch the recent tracks ofartist
- The artist name you are interested inpage
- An integer used to fetch a specific page of tracksstartTimestamp
- An unix timestamp to start atendTimestamp
- An unix timestamp to end atapiKey
- A Last.fm API key- Returns:
- a list of Tracks
-
getFriends
-
getFriends
public static Collection<User> getFriends(String user, boolean recenttracks, int limit, String apiKey) -
getNeighbours
-
getNeighbours
-
getRecentTracks
-
getRecentTracks
public static PaginatedResult<Track> getRecentTracks(String user, int limit, String apiKey, int page) -
getTopAlbums
-
getTopAlbums
-
getTopArtists
-
getTopArtists
-
getTopTracks
-
getTopTracks
-
getTopTags
-
getTopTags
-
getWeeklyAlbumChart
-
getWeeklyAlbumChart
-
getWeeklyAlbumChart
-
getWeeklyArtistChart
-
getWeeklyArtistChart
-
getWeeklyArtistChart
-
getWeeklyTrackChart
-
getWeeklyTrackChart
-
getWeeklyTrackChart
-
getWeeklyChartList
-
getWeeklyChartListAsCharts
-
getEvents
GetS a list of upcoming events that this user is attending.- Parameters:
user
- The user to fetch the events for.apiKey
- A Last.fm API key.- Returns:
- a list of upcoming events
-
getPastEvents
Get the first page of a paginated result of all events a user has attended in the past.- Parameters:
user
- The username to fetch the events for.apiKey
- A Last.fm API key.- Returns:
- a list of past
Event
s
-
getPastEvents
Gets a paginated list of all events a user has attended in the past.- Parameters:
user
- The username to fetch the events for.page
- The page number to scan to.apiKey
- A Last.fm API key.- Returns:
- a list of past
Event
s
-
getRecommendedEvents
-
getRecommendedEvents
-
getPlaylists
Gets a list of a user's playlists on Last.fm. Note that this method only fetches metadata regarding the user's playlists. If you want to retrieve the list of tracks in a playlist usePlaylist.fetch()
.- Parameters:
user
- The last.fm username to fetch the playlists of.apiKey
- A Last.fm API key.- Returns:
- a list of Playlists
-
getLovedTracks
Retrieves the loved tracks by a user.- Parameters:
user
- The user name to fetch the loved tracks for.apiKey
- A Last.fm API key.- Returns:
- the loved tracks
-
getLovedTracks
Retrieves the loved tracks by a user.- Parameters:
user
- The user name to fetch the loved tracks for.page
- The page number to scan toapiKey
- A Last.fm API key.- Returns:
- the loved tracks
-
getInfo
Retrieves profile information about the specified user.- Parameters:
user
- A usernameapiKey
- A Last.fm API key.- Returns:
- User info
-
getRecommendedArtists
Get Last.fm artist recommendations for a user.- Parameters:
session
- A Session instance- Returns:
- a list of
Artist
s
-
getRecommendedArtists
Get Last.fm artist recommendations for a user.- Parameters:
page
- The page to fetchsession
- A Session instance- Returns:
- a list of
Artist
s
-
shout
Shout on this user's shoutbox- Parameters:
user
- The name of the user to shout onmessage
- The message to post to the shoutboxsession
- A Session instance- Returns:
- the result of the operation
-
getNewReleases
Gets a list of forthcoming releases based on a user's musical taste.- Parameters:
user
- The Last.fm usernameapiKey
- A Last.fm API key- Returns:
- a Collection of new
Album
releases
-
getNewReleases
public static Collection<Album> getNewReleases(String user, boolean useRecommendations, String apiKey) Gets a list of forthcoming releases based on a user's musical taste.- Parameters:
user
- The Last.fm usernameuseRecommendations
- Iftrue
, the feed contains new releases based on Last.fm's artist recommendations for this user. Otherwise, it is based on their library (the default)apiKey
- A Last.fm API key- Returns:
- a Collection of new
Album
releases
-
getBannedTracks
Returns the tracks banned by the user.- Parameters:
user
- The user nameapiKey
- A Last.fm API key- Returns:
- the banned tracks
-
getBannedTracks
Returns the tracks banned by the user.- Parameters:
user
- The user namepage
- The page number to fetchapiKey
- A Last.fm API key- Returns:
- the banned tracks
-