Skip to content

Conversation

@mick
Copy link

@mick mick commented Sep 30, 2019

One of the options for on load display is to show all current events on the map #21

One of the issues with that is fetching them from mobilizeamerica api takes several requests in serial adding up to 10 secs+ (and will continue to grow with more events!) But I do think that seeing events all across the USA is powerful.

If we pre-fetched the events from the api and strip out anything we arent going to display on the map (events without locations, unused attributes, etc) we can cache that bundle. Then we can quickly slow all events on the map. The current events.json is ~ 85kb gzipped.

This PR includes scripts for fetching all events from the API & filtering attributes / events. Then it posts to events.json to AWS S3. This is currently running as an hourly scheduled tasks on Heroku. Could be moved elsewhere easily, but I think the campaign is already using Heroku. This PR is only the backend task. Frontend changes for using the bundle separated into another PR.

Bundle is available at: https://warren-events.s3.amazonaws.com/data/events.json

cc @jasonkalmeida

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant