Class: LastFM::Geo

Inherits:
Object
  • Object
show all
Defined in:
lib/lastfm/geo.rb

Class Method Summary collapse

Class Method Details

.get_events(params) ⇒ Object

Get all events in a specific location by country or city name.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :location (String, optional)

    location to retrieve events for

  • :lat (String, optional)

    latitude value to retrieve events for

  • :long (String, optional)

    longitude value to retrieve events for

  • :distance (Fixnum, optional)

    find events within a specified radius (in kilometres)

  • :page (Fixnum, optional)

    the page number to fetch. defaults to first page

  • :limit (Fixnum, optional)

    the number of results to fetch per page. defaults to 50

See Also:



14
15
16
# File 'lib/lastfm/geo.rb', line 14

def get_events( params )
  LastFM.get( "geo.getEvents", !:secure, params )
end

.get_metro_artist_chart(params) ⇒ Object

Get a chart of artists for a metro.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



25
26
27
# File 'lib/lastfm/geo.rb', line 25

def get_metro_artist_chart( params )
  LastFM.get( "geo.getMetroArtistChart", params )
end

.get_metro_hype_artist_chart(params) ⇒ Object

Get a chart of hyped (up and coming) artists for a metro.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



36
37
38
# File 'lib/lastfm/geo.rb', line 36

def get_metro_hype_artist_chart( params )
  LastFM.get( "geo.getMetroHypeArtistChart", params )
end

.get_metro_hype_track_chart(params) ⇒ Object

Get a chart of hyped (up and coming) tracks for a metro.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



47
48
49
# File 'lib/lastfm/geo.rb', line 47

def get_metro_hype_track_chart( params )
  LastFM.get( "geo.getMetroHypeTrackChart", params )
end

.get_metro_track_chart(params) ⇒ Object

Get a chart of tracks for a metro.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



58
59
60
# File 'lib/lastfm/geo.rb', line 58

def get_metro_track_chart( params )
  LastFM.get( "geo.getMetroTrackChart", params )
end

.get_metro_unique_artist_chart(params) ⇒ Object

Get a chart of the artists which make that metro unique

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



69
70
71
# File 'lib/lastfm/geo.rb', line 69

def get_metro_unique_artist_chart( params )
  LastFM.get( "geo.getMetroUniqueArtistChart", params )
end

.get_metro_unique_track_chart(params) ⇒ Object

Get a chart of the tracks which make that metro unique

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :metro (String, required)

    the metro’s name

  • :start (Time, optional)

    beginning timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

  • :end (Time, optional)

    ending timestamp of the weekly range requested (see: Geo.get_weekly_chart_list)

See Also:



80
81
82
# File 'lib/lastfm/geo.rb', line 80

def get_metro_unique_track_chart( params )
  LastFM.get( "geo.getMetroUniqueTrackChart", params )
end

.get_metro_weekly_chartlist(params) ⇒ Object

Get a list of available chart periods for this metro, expressed as date ranges which can be sent to the chart services.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :metro (String, required)

    metro name to fetch the charts list for

See Also:



88
89
90
# File 'lib/lastfm/geo.rb', line 88

def get_metro_weekly_chartlist( params )
  LastFM.get( "geo.getMetroWeeklyChartlist", params )
end

.get_metros(params) ⇒ Object

Get a list of valid countries and metros for use in the other webservices

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, optional)

    restrict results to metros from a particular country, as defined by ISO 3166-1

See Also:



96
97
98
# File 'lib/lastfm/geo.rb', line 96

def get_metros( params )
  LastFM.get( "geo.getMetros", params )
end

.get_top_artists(params) ⇒ Object

Get the most popular artists on Last.fm by country

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :page (Fixnum, optional)

    the page number to fetch. defaults to first page

  • :limit (Fixnum, optional)

    the number of results to fetch per page. defaults to 50

See Also:



106
107
108
# File 'lib/lastfm/geo.rb', line 106

def get_top_artists( params )
  LastFM.get( "geo.getTopArtists", params )
end

.get_top_tracks(params) ⇒ Object

Get the most popular tracks on Last.fm by country

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :country (String, required)

    a country name, as defined by ISO 3166-1

  • :location (String, optional)

    location to fetch the charts for

  • :page (Fixnum, optional)

    the page number to fetch. defaults to first page

  • :limit (Fixnum, optional)

    the number of results to fetch per page. defaults to 50

See Also:



117
118
119
# File 'lib/lastfm/geo.rb', line 117

def get_top_tracks( params )
  LastFM.get( "geo.getTopTracks", params )
end