Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre fetch/bundle events from mobilizeamerica to 1 file. #27

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

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.

None yet

1 participant