Build a Github Pages cache of Politician images for a country from EveryPolitician data.
Images referenced in EveryPolitician aren't necessarily free to use. You should check licensing etc before actively reusing them.
First click this button and follow the setup instructions:
You'll be able to choose a name for your new app. You'll also need to configure 3 settings:
GITHUB_REPO
- This should be the name of the repo you want to push the images to, in the formuser_or_org/repo_slug
.GITHUB_ACCESS_TOKEN
- A Personal Access Token with permission to push to theGITHUB_REPO
.EVERYPOLITICIAN_COUNTRY_SLUG
- Theslug
of the country you want to cache images for. Find slugs in everypolitician-data's countries.json.
After the app has been created go to the Heroku Dashboard, select the newly created app and then click on the "Heroku Scheduler" add-on to get to the Scheduler Dashboard.
On the Scheduler Dashboard add a new job which runs bin/image_cache
once an hour:
You’re done! You can view the logs of the app using the following command, replacing <app-name>
with the name of the app you created.
heroku logs --tail --app <app-name>