Pre fetch/bundle events from mobilizeamerica to 1 file. #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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