Class: LastFM::Api::Event

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

Class Method Summary collapse

Class Method Details

.attend(params) ⇒ Object

Set a user’s attendance status for an event.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

  • :status (Symbol, required)

    attendance status. accepted values are :attending, :maybe_attending, and :not_attending

See Also:



11
12
13
14
15
16
# File 'lib/lastfm/api/event.rb', line 11

def attend( params )
  LastFM.requires_authentication
  status_codes = { attending: 0, maybe_attending: 1, not_attending: 2 }
  params[:status] = status_codes[params[:status]] if params.include?(:status)
  LastFM.post( "event.attend", params )
end

.get_attendees(params) ⇒ Object

Get a list of attendees for an event.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

  • :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:



24
25
26
# File 'lib/lastfm/api/event.rb', line 24

def get_attendees( params )
  LastFM.get( "event.getAttendees", params )
end

.get_info(params) ⇒ Object

Get the metadata for an event on Last.fm. Includes attendance and lineup information.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

See Also:



32
33
34
# File 'lib/lastfm/api/event.rb', line 32

def get_info( params )
  LastFM.get( "event.getInfo", params )
end

.get_shouts(params) ⇒ Object

Get shouts for an event.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

  • :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:



42
43
44
# File 'lib/lastfm/api/event.rb', line 42

def get_shouts( params )
  LastFM.get( "event.getShouts", params )
end

.share(params) ⇒ Object

Share an event with one or more Last.fm users or other friends.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

  • :recipient (Array, required)

    a list of email addresses or Last.fm usernames. maximum is 10

  • :message (String, optional)

    an optional message to send. if not supplied a default message will be used

  • :public (Boolean, optional)

    optionally show in the sharing users activity feed. defaults to false

See Also:



53
54
55
56
# File 'lib/lastfm/api/event.rb', line 53

def share( params )
  LastFM.requires_authentication
  LastFM.post( "event.share", params )
end

.shout(params) ⇒ Object

Shout in an event’s shoutbox.

Parameters:

  • params (Hash)

    a customizable set of options

Options Hash (params):

  • :event (Fixnum, required)

    numeric last.fm event id

  • :message (String, required)

    message to post to the shoutbox

See Also:



63
64
65
66
# File 'lib/lastfm/api/event.rb', line 63

def shout( params )
  LastFM.requires_authentication
  LastFM.post( "event.shout", params )
end