Class: Jekyll::Meetup::ApiClient

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/meetup/api_client.rb

Overview

Simple API client for Meetup since there doesn’t seem to be an open source one that supports OAuth.

Constant Summary collapse

API_BASE =
URI('https://api.meetup.com')

Class Method Summary collapse

Class Method Details

.events(urlname) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/jekyll/meetup/api_client.rb', line 11

def self.events(urlname)
  request_uri = API_BASE + format('%<urlname>s/events', urlname: urlname)
  request_uri.query = URI.encode_www_form(
    scroll: 'next_upcoming'
  )

  body = Net::HTTP.get(request_uri)
  JSON.parse(body)
end