public class User extends ImageHolder
Modifier and Type | Class and Description |
---|---|
private static class |
User.UserFactory |
Modifier and Type | Field and Description |
---|---|
private int |
age |
private String |
country |
(package private) static ItemFactory<User> |
FACTORY |
private String |
gender |
private String |
id |
private String |
language |
private String |
name |
private int |
numPlaylists |
private int |
playcount |
private String |
realname |
private Date |
registeredDate |
private boolean |
subscriber |
private String |
url |
imageUrls
Modifier | Constructor and Description |
---|---|
private |
User(String name,
String url) |
Modifier and Type | Method and Description |
---|---|
int |
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.
|
String |
getCountry() |
static PaginatedResult<Event> |
getEvents(String user,
boolean festivalsOnly,
int page,
int limit,
String apiKey)
GetS a list of upcoming events that this user is attending.
|
static PaginatedResult<Event> |
getEvents(String user,
int page,
String apiKey)
GetS a list of upcoming events that this user is attending.
|
static PaginatedResult<Event> |
getEvents(String user,
String apiKey)
GetS a list of upcoming events that this user is attending.
|
static PaginatedResult<User> |
getFriends(String user,
boolean recenttracks,
int page,
int limit,
String apiKey) |
static PaginatedResult<User> |
getFriends(String user,
String apiKey) |
String |
getGender() |
String |
getId() |
String |
getImageURL() |
static User |
getInfo(Session session)
Retrieves profile information about the authenticated user.
|
static User |
getInfo(String user,
String apiKey)
Retrieves profile information about the specified user.
|
String |
getLanguage() |
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.
|
String |
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 |
getNumPlaylists() |
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.
|
static <T extends MusicEntry> |
getPersonalTags(String user,
String tag,
Class<T> taggingType,
int page,
int limit,
String apiKey)
Get the user's personal tags.
|
static <T extends MusicEntry> |
getPersonalTags(String user,
String tag,
Class<T> taggingType,
int page,
String apiKey)
Get the user's personal tags.
|
static <T extends MusicEntry> |
getPersonalTags(String user,
String tag,
Class<T> taggingType,
String apiKey)
Get the user's personal tags.
|
int |
getPlaycount() |
static Collection<Playlist> |
getPlaylists(String user,
String apiKey)
Gets a list of a user's playlists on Last.fm.
|
String |
getRealname() |
static PaginatedResult<Track> |
getRecentTracks(String user,
int page,
int limit,
String apiKey) |
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) |
Date |
getRegisteredDate() |
static PaginatedResult<Shout> |
getShouts(String user,
int page,
int limit,
String apiKey)
Get shouts for a user.
|
static PaginatedResult<Shout> |
getShouts(String user,
int page,
String apiKey)
Get shouts for a user.
|
static PaginatedResult<Shout> |
getShouts(String user,
String apiKey)
Get shouts for a user.
|
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) |
String |
getUrl() |
static Chart<Album> |
getWeeklyAlbumChart(String user,
int limit,
String apiKey) |
static Chart<Album> |
getWeeklyAlbumChart(String user,
String apiKey) |
static Chart<Album> |
getWeeklyAlbumChart(String user,
String from,
String to,
int limit,
String apiKey) |
static Chart<Artist> |
getWeeklyArtistChart(String user,
int limit,
String apiKey) |
static Chart<Artist> |
getWeeklyArtistChart(String user,
String apiKey) |
static Chart<Artist> |
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) |
static Chart<Track> |
getWeeklyTrackChart(String user,
int limit,
String apiKey) |
static Chart<Track> |
getWeeklyTrackChart(String user,
String apiKey) |
static Chart<Track> |
getWeeklyTrackChart(String user,
String from,
String to,
int limit,
String apiKey) |
boolean |
isSubscriber() |
static Result |
shout(String user,
String message,
Session session)
Shout on this user's shoutbox
|
availableSizes, getImageURL, loadImages
static final ItemFactory<User> FACTORY
private int age
private boolean subscriber
private int numPlaylists
private int playcount
private Date registeredDate
public String getRealname()
public int getAge()
public String getCountry()
public String getLanguage()
public int getNumPlaylists()
public int getPlaycount()
public boolean isSubscriber()
public String getImageURL()
public Date getRegisteredDate()
public static PaginatedResult<Track> getArtistTracks(String user, String artist, String apiKey)
user
- The last.fm username to fetch the recent tracks ofartist
- The artist name you are interested inapiKey
- A Last.fm API keypublic static PaginatedResult<Track> getArtistTracks(String user, String artist, int page, long startTimestamp, long endTimestamp, String apiKey)
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 keypublic static PaginatedResult<User> getFriends(String user, String apiKey)
public static PaginatedResult<User> getFriends(String user, boolean recenttracks, int page, int limit, String apiKey)
public static Collection<User> getNeighbours(String user, String apiKey)
public static Collection<User> getNeighbours(String user, int limit, String apiKey)
public static PaginatedResult<Track> getRecentTracks(String user, String apiKey)
public static PaginatedResult<Track> getRecentTracks(String user, int page, int limit, String apiKey)
public static Collection<Album> getTopAlbums(String user, String apiKey)
public static Collection<Album> getTopAlbums(String user, Period period, String apiKey)
public static Collection<Artist> getTopArtists(String user, String apiKey)
public static Collection<Artist> getTopArtists(String user, Period period, String apiKey)
public static Collection<Track> getTopTracks(String user, String apiKey)
public static Collection<Track> getTopTracks(String user, Period period, String apiKey)
public static Collection<Tag> getTopTags(String user, String apiKey)
public static Collection<Tag> getTopTags(String user, int limit, String apiKey)
public static Chart<Album> getWeeklyAlbumChart(String user, String apiKey)
public static Chart<Album> getWeeklyAlbumChart(String user, int limit, String apiKey)
public static Chart<Album> getWeeklyAlbumChart(String user, String from, String to, int limit, String apiKey)
public static Chart<Artist> getWeeklyArtistChart(String user, String apiKey)
public static Chart<Artist> getWeeklyArtistChart(String user, int limit, String apiKey)
public static Chart<Artist> getWeeklyArtistChart(String user, String from, String to, int limit, String apiKey)
public static Chart<Track> getWeeklyTrackChart(String user, String apiKey)
public static Chart<Track> getWeeklyTrackChart(String user, int limit, String apiKey)
public static Chart<Track> getWeeklyTrackChart(String user, String from, String to, int limit, String apiKey)
public static LinkedHashMap<String,String> getWeeklyChartList(String user, String apiKey)
public static Collection<Chart> getWeeklyChartListAsCharts(String user, String apiKey)
public static PaginatedResult<Event> getEvents(String user, String apiKey)
user
- The user to fetch the events for.apiKey
- A Last.fm API key.public static PaginatedResult<Event> getEvents(String user, int page, String apiKey)
user
- The user to fetch the events for.page
- The page number to fetch. Defaults to first page.apiKey
- A Last.fm API key.public static PaginatedResult<Event> getEvents(String user, boolean festivalsOnly, int page, int limit, String apiKey)
user
- The user to fetch the events for.page
- The page number to fetch. Defaults to first page.limit
- The number of results to fetch per page. Defaults to 50.festivalsOnly
- Whether only festivals should be returned, or all events.apiKey
- A Last.fm API key.public static PaginatedResult<Event> getPastEvents(String user, String apiKey)
user
- The username to fetch the events for.apiKey
- A Last.fm API key.Event
spublic static PaginatedResult<Event> getPastEvents(String user, int page, String apiKey)
user
- The username to fetch the events for.page
- The page number to scan to.apiKey
- A Last.fm API key.Event
spublic static PaginatedResult<Event> getRecommendedEvents(Session session)
public static PaginatedResult<Event> getRecommendedEvents(int page, Session session)
public static Collection<Playlist> getPlaylists(String user, String apiKey)
Playlist.fetch()
.user
- The last.fm username to fetch the playlists of.apiKey
- A Last.fm API key.public static PaginatedResult<Track> getLovedTracks(String user, String apiKey)
user
- The user name to fetch the loved tracks for.apiKey
- A Last.fm API key.public static PaginatedResult<Track> getLovedTracks(String user, int page, String apiKey)
user
- The user name to fetch the loved tracks for.page
- The page number to scan toapiKey
- A Last.fm API key.public static User getInfo(String user, String apiKey)
user
- A usernameapiKey
- A Last.fm API key.public static User getInfo(Session session)
session
- A session for the user, for whom to get the profile forpublic static PaginatedResult<Artist> getRecommendedArtists(Session session)
session
- A Session instanceArtist
spublic static PaginatedResult<Artist> getRecommendedArtists(int page, Session session)
page
- The page to fetchsession
- A Session instanceArtist
spublic static Result shout(String user, String message, Session session)
user
- The name of the user to shout onmessage
- The message to post to the shoutboxsession
- A Session instancepublic static Collection<Album> getNewReleases(String user, String apiKey)
user
- The Last.fm usernameapiKey
- A Last.fm API keyAlbum
releasespublic static Collection<Album> getNewReleases(String user, boolean useRecommendations, String apiKey)
user
- The Last.fm usernameuseRecommendations
- If true
, 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 keyAlbum
releasespublic static PaginatedResult<Track> getBannedTracks(String user, String apiKey)
user
- The user nameapiKey
- A Last.fm API keypublic static PaginatedResult<Track> getBannedTracks(String user, int page, String apiKey)
user
- The user namepage
- The page number to fetchapiKey
- A Last.fm API keypublic static PaginatedResult<Shout> getShouts(String user, String apiKey)
user
- The username to fetch shouts forapiKey
- A Last.fm API key.Shout
spublic static PaginatedResult<Shout> getShouts(String user, int page, String apiKey)
user
- The username to fetch shouts forpage
- The page number to fetchapiKey
- A Last.fm API key.Shout
spublic static PaginatedResult<Shout> getShouts(String user, int page, int limit, String apiKey)
user
- The username to fetch shouts forpage
- The page number to fetchlimit
- An integer used to limit the number of shouts returned per page or -1 for defaultapiKey
- A Last.fm API key.Shout
spublic static <T extends MusicEntry> PaginatedResult<T> getPersonalTags(String user, String tag, Class<T> taggingType, String apiKey)
user
- The user who performed the taggingstag
- The tag you're interested intaggingType
- Either Artist.class
, Album.class
or Track.class
apiKey
- A Last.fm API keyIllegalArgumentException
- if taggingType
is null
or not one of the above mentioned classespublic static <T extends MusicEntry> PaginatedResult<T> getPersonalTags(String user, String tag, Class<T> taggingType, int page, String apiKey)
user
- The user who performed the taggingstag
- The tag you're interested intaggingType
- Either Artist.class
, Album.class
or Track.class
page
- The page number to fetchapiKey
- A Last.fm API keyIllegalArgumentException
- if taggingType
is null
or not one of the above mentioned classespublic static <T extends MusicEntry> PaginatedResult<T> getPersonalTags(String user, String tag, Class<T> taggingType, int page, int limit, String apiKey)
user
- The user who performed the taggingstag
- The tag you're interested intaggingType
- Either Artist.class
, Album.class
or Track.class
page
- The page number to fetchlimit
- The number of results to fetch per page. Defaults to 50apiKey
- A Last.fm API keyIllegalArgumentException
- if taggingType
is null
or not one of the above mentioned classesWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses