codeforamerica / cfapi

The Code for America API. Tracks and motivates activity and participation across the civic technology movement.
http://codeforamerica.org/api
MIT License
113 stars 52 forks source link

Fetch most recent meetup events for each organization #315

Closed tdooner closed 6 years ago

tdooner commented 6 years ago

This updates the base URL we are using to fetch events for brigades to ensure we're getting the latest events.

Previously the query had no pagination direction specified, so it defaulted to ascending based on time. This means that groups with more than the default page limit's worth of events would never have any recent events.

I also updated the "page" argument in the URL to fetch the most recent 200 events. This is probably overkill, but since Meetup creates recurring events for up to a year in advance, I wanted to make sure to at least get the history of these events, if a brigade had up to 3 weekly recurring events. Later, we should just paginate through events until we get some predetermined distance in the past (i.e. we stop checking for updates to events one month after they happen).