Skip to content

spotlightpa/viz-amendment-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotlight PA Amendment Tracker

Installation

  • Install Go. See .go-version for minimum version.
  • Install Hugo. See netlify.toml for minimum version.
  • Run yarn to install JavaScript dependencies. See netlify.toml for minimum version.

Architecture

There is a Google Sheet containing the rows for the ammendments being considered by the PA State Legislature.

go run ./cmd/amtrack is a Go script to download that sheet, connect to the Open States API for supplemental data about the bills, and write out assets/json/amtrack.json with an organized view of the data.

Hugo looks at amtrack.json and uses it to build a static site based on that data.

Github Actions has a workflow called scrape.yml which runs every 6 hours to trigger a run of the amtrack script and save any changes to amtrack.json to git.

When the main branch of the Github repo changes, Netlify deploys a new build.

Usage

Required secrets

Command line options for Amtrack

  -cache-dir directory path
        request cache directory path
  -delay duration
        delay between Open States requests (default 1s)
  -google-client-secret base64 encoded JSON
        base64 encoded JSON of Google client secret
  -open-states-key key
        API key for Open States
  -sheet value
        Google Sheet ID
  -write file path
        destination file path (default "amtrack.json")

Embed code

The production embed code is:

<script src="https://viz-amendment-tracker.data.spotlightpa.org/embed.js" defer></script><div data-spl-interactive="viz-amendment-tracker"></div><small><a href="https://viz-amendment-tracker.data.spotlightpa.org">Click here if you have trouble loading this visualization</a></small>

Alternative embed codes can be tested by changing the script URL.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published