Package de.umass.lastfm
Class Geo
java.lang.Object
de.umass.lastfm.Geo
Provides nothing more than a namespace for the API methods starting with geo.
- Author:
- Janni Kovacs
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This inner class represents a Metro, which is composed of its name and the name of its country. -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Event>
getAllEvents
(String location, String distance, String apiKey) Get all events in a specific location by country or city name.
This method returns all events by subsequently callinggetEvents(String, String, int, String)
and concatenating the single results into one list.
Pay attention if you use this method as it may produce a lot of network traffic and therefore may consume a long time.static PaginatedResult<Event>
Get all events in a specific location by country or city name.
This method only returns the specified page of a paginated result.static PaginatedResult<Event>
Get all events in a specific location by country or city name.
This method only returns the specified page of a paginated result.static PaginatedResult<Event>
Get all events in a specific location by country or city name.
This method only returns the first page of a possibly paginated result.getMetroArtistChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroArtistChart
(String country, String metro, String apiKey) getMetroHypeArtistChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroHypeArtistChart
(String country, String metro, String apiKey) getMetroHypeTrackChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroHypeTrackChart
(String country, String metro, String apiKey) static Collection<Geo.Metro>
Get a list of valid countries andGeo.Metro
s for use in the other webservices.static Collection<Geo.Metro>
Get a list of valid countries andGeo.Metro
s for use in the other webservices.getMetroTrackChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroTrackChart
(String country, String metro, String apiKey) getMetroUniqueArtistChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroUniqueArtistChart
(String country, String metro, String apiKey) getMetroUniqueTrackChart
(Geo.Metro metro, String start, String end, String apiKey) getMetroUniqueTrackChart
(String country, String metro, String apiKey) static LinkedHashMap<String,
String> getMetroWeeklyChartList
(String metro, String apiKey) Get a list of available chart periods for this metro, expressed as date ranges which can be sent to the chart services.static Collection<Artist>
getTopArtists
(String country, String apiKey) Get the most popular artists on Last.fm by countrystatic Collection<Track>
getTopTracks
(String country, String apiKey) Get the most popular tracks on Last.fm by country
-
Method Details
-
getAllEvents
Get all events in a specific location by country or city name.
This method returns all events by subsequently callinggetEvents(String, String, int, String)
and concatenating the single results into one list.
Pay attention if you use this method as it may produce a lot of network traffic and therefore may consume a long time.- Parameters:
location
- Specifies a location to retrieve events fordistance
- Find events within a specified distanceapiKey
- A Last.fm API key.- Returns:
- a list containing all events
-
getEvents
Get all events in a specific location by country or city name.
This method only returns the first page of a possibly paginated result. To retrieve all pages get the total number of pages viaPaginatedResult.getTotalPages()
and subsequently callgetEvents(String, String, int, String)
with the successive page numbers.- Parameters:
location
- Specifies a location to retrieve events fordistance
- Find events within a specified distanceapiKey
- A Last.fm API key.- Returns:
- a
PaginatedResult
containing a list of events
-
getEvents
public static PaginatedResult<Event> getEvents(String location, String distance, int page, String apiKey) Get all events in a specific location by country or city name.
This method only returns the specified page of a paginated result.- Parameters:
location
- Specifies a location to retrieve events fordistance
- Find events within a specified distancepage
- A page number for paginationapiKey
- A Last.fm API key.- Returns:
- a
PaginatedResult
containing a list of events
-
getEvents
public static PaginatedResult<Event> getEvents(double latitude, double longitude, int page, String apiKey) Get all events in a specific location by country or city name.
This method only returns the specified page of a paginated result.- Parameters:
latitude
- Latitudelongitude
- Longitudepage
- A page number for paginationapiKey
- A Last.fm API key.- Returns:
- a
PaginatedResult
containing a list of events
-
getTopArtists
Get the most popular artists on Last.fm by country- Parameters:
country
- A country name, as defined by the ISO 3166-1 country names standardapiKey
- A Last.fm API key.- Returns:
- list of Artists
-
getTopTracks
Get the most popular tracks on Last.fm by country- Parameters:
country
- A country name, as defined by the ISO 3166-1 country names standardapiKey
- A Last.fm API key.- Returns:
- a list of Tracks
-
getMetros
Get a list of valid countries andGeo.Metro
s for use in the other webservices.- Parameters:
apiKey
- A Last.fm API key- Returns:
- a List of
Geo.Metro
s
-
getMetros
Get a list of valid countries andGeo.Metro
s for use in the other webservices.- Parameters:
country
- Optionally restrict the results to those Metros from a particular country, as defined by the ISO 3166-1 country names standardapiKey
- A Last.fm API key- Returns:
- a List of
Geo.Metro
s
-
getMetroWeeklyChartList
Get a list of available chart periods for this metro, expressed as date ranges which can be sent to the chart services.- Parameters:
metro
- The name of the metro, ornull
apiKey
- A Last.fm API key- Returns:
- a list of available charts as a Map
-
getMetroArtistChart
-
getMetroArtistChart
-
getMetroArtistChart
-
getMetroTrackChart
-
getMetroTrackChart
-
getMetroTrackChart
-
getMetroHypeArtistChart
-
getMetroHypeArtistChart
-
getMetroHypeArtistChart
-
getMetroHypeTrackChart
-
getMetroHypeTrackChart
-
getMetroHypeTrackChart
-
getMetroUniqueArtistChart
-
getMetroUniqueArtistChart
-
getMetroUniqueArtistChart
-
getMetroUniqueTrackChart
-
getMetroUniqueTrackChart
-
getMetroUniqueTrackChart
-