Class: Lanyrd::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/lanyrd/client.rb

Instance Method Summary collapse

Instance Method Details

#attendees(slug, year = Time.now.year) ⇒ Object


23
24
25
# File 'lib/lanyrd/client.rb', line 23

def attendees(slug, year = Time.now.year)
  get_rows(get("#{year}/#{slug}/attendees/")['sections'])
end

#event(slug, year = Time.now.year) ⇒ Object


15
16
17
# File 'lib/lanyrd/client.rb', line 15

def event(slug, year = Time.now.year)
  get("#{year}/#{slug}/")
end

#future_events(username) ⇒ Object


35
36
37
# File 'lib/lanyrd/client.rb', line 35

def future_events(username)
  get("profile/#{username}/action/")['events']
end

11
12
13
# File 'lib/lanyrd/client.rb', line 11

def popular
  get("search/")['sections'][0]['rows']
end

#profile(username) ⇒ Object


31
32
33
# File 'lib/lanyrd/client.rb', line 31

def profile(username)
  get("profile/#{username}/")
end

#schedule(slug, year = Time.now.year) ⇒ Object


27
28
29
# File 'lib/lanyrd/client.rb', line 27

def schedule(slug, year = Time.now.year)
  get_rows(get("#{year}/#{slug}/schedule/")['sections'])
end

#search(query, params = {}) ⇒ Object

Specify search term with params. Params include :topic => topic


6
7
8
9
# File 'lib/lanyrd/client.rb', line 6

def search(query, params = {})
  params = URI.escape(params.collect{|k,v| "#{k}=#{v}"}.join('&')).insert 0, "&"
  get("search/?q=#{query}#{params}")['sections'][0]['rows']
end

#speakers(slug, year = Time.now.year) ⇒ Object


19
20
21
# File 'lib/lanyrd/client.rb', line 19

def speakers(slug, year = Time.now.year)
  get_rows(get("#{year}/#{slug}/speakers/")["sections"])
end