Skip to content

dslaw/marion-booking-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Marion Booking Log

Scrape the Marion County, Oregon booking log.

Usage

First, ensure the following environment variables are set and exported:

  • POSTGRES_PORT
  • POSTGRES_DATABASE
  • POSTGRES_USER
  • POSTGRES_PASSWORD

Create a Postgres (11+) database. docker can be used to create one:

docker run \
    -d \
    -p ${POSTGRES_PORT}:5432 \
    -e POSTGRES_USER=${POSTGRES_USER} \
    -e POSTGRES_DB=${POSTGRES_DATABASE} \
    -e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
    --name=marion-jail-db \
    postgres:11

Then build the container for the web scraper:

docker build . --tag=marion-jail-scraper

Use the web scraper container to setup the database:

docker run \
    --rm \
    --net=host \
    -e POSTGRES_HOST=localhost \
    -e POSTGRES_PORT=${POSTGRES_PORT} \
    -e POSTGRES_DATABASE=${POSTGRES_DATABASE} \
    -e POSTGRES_USER=${POSTGRES_USER} \
    -e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
    --name=marion-jail-scraper \
    marion-jail-scraper:latest \
    --setup-db

And run the scraper, sending logging statements to stdout:

docker run \
    --rm \
    --net=host \
    -e POSTGRES_HOST=localhost \
    -e POSTGRES_PORT=${POSTGRES_PORT} \
    -e POSTGRES_DATABASE=${POSTGRES_DATABASE} \
    -e POSTGRES_USER=${POSTGRES_USER} \
    -e POSTGRES_PASSWORD=${POSTGRES_PASSWORD} \
    --name=marion-jail-scraper \
    marion-jail-scraper:latest

About

Scrape Marion County Jail booking log.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published