lib/lanyrd/client.rb in lanyrd-0.0.1 vs lib/lanyrd/client.rb in lanyrd-0.1.1

- old
+ new

@@ -3,35 +3,44 @@ def search(query) get "search/?q=#{query}" end def popular - get "popular/" + get "search/" end - def event(id) - get "event/#{id}/" + def event(slug, year = Time.now.year) + get "#{year}/#{slug}/" end - def speakers(event_id) - get "speakers/#{event_id}/" + def speakers(slug, year = Time.now.year) + get "#{year}/#{slug}/speakers/" end - def attendees(event_id) - get "attendees/#{event_id}/" + def attendees(slug, year = Time.now.year) + get "#{year}/#{slug}/attendees/" end + + def schedule(slug, year = Time.now.year) + get "#{year}/#{slug}/schedule/" + end + + def profile(username) + get "profile/#{username}/" + end + private + def get(path) - response = conenction.get path + response = connection.get path decode response.body end def decode(data) - plist = CFPropertyList::List.new(:data => data) - CFPropertyList.native_types(plist.value) + JSON.parse(data) end - def conenction - Faraday.new(:url => 'http://lanyrd.com/mobile/ios/') + def connection + Faraday.new(:url => 'http://lanyrd.com/mobile/ios2/') end end end \ No newline at end of file