Skip to content

Build a cache (on GitHub Pages) of politicians' images for a country from EveryPolitician data

Notifications You must be signed in to change notification settings

everypolitician/image_cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Cache

Build a Github Pages cache of Politician images for a country from EveryPolitician data.

Disclaimer

Images referenced in EveryPolitician aren't necessarily free to use. You should check licensing etc before actively reusing them.

Deploying to Heroku

First click this button and follow the setup instructions:

Deploy

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 form user_or_org/repo_slug.
  • GITHUB_ACCESS_TOKEN - A Personal Access Token with permission to push to the GITHUB_REPO.
  • EVERYPOLITICIAN_COUNTRY_SLUG - The slug of the country you want to cache images for. Find slugs in everypolitician-data's countries.json.

screen shot 2015-12-18 at 18 03 03

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.

screen shot 2015-12-18 at 18 07 06

On the Scheduler Dashboard add a new job which runs bin/image_cache once an hour:

screen shot 2015-12-18 at 17 26 56

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>

About

Build a cache (on GitHub Pages) of politicians' images for a country from EveryPolitician data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages