Skip to content

Instantly share code, notes, and snippets.

@mneedham
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mneedham/9990977 to your computer and use it in GitHub Desktop.
Save mneedham/9990977 to your computer and use it in GitHub Desktop.
(defn offsets [perpage]
(map #(* perpage %) (range)))
(defn events
[{perpage :perpage offset :offset orderby :orderby}]
(->> (client/get
(str "https://api.meetup.com/2/events?page=" perpage
"&offset=" offset
"&orderby=" orderby
"&status=upcoming,past&"
"&group_urlname=" MEETUP_NAME
"&key=" MEETUP_KEY)
{:as :json})
:body :results))
(defn all-events []
(flatten
(take-while seq
(map #(events {:perpage 200 :offset % :orderby "name"}) (offsets 200)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment