Results parser working for all LGAs (except melbourne)

This commit is contained in:
Kim Taylor
2024-11-16 12:03:29 +11:00
parent 464d617ecc
commit f8fd1cc20c
4 changed files with 235 additions and 17 deletions

21
update-elected.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# This script uses the jq, wp, and php commands, make sure they are installed before running this script.
# The folder containing data for each council.
# Includes the list of candidates and any media.
DATA_PATH="../spl-data"
# Iterate over folders in data path
candidates_files=()
for folder in "$DATA_PATH"/*; do
if test -f "$folder"/candidates-generic.csv; then
candidates_files+=("$folder"/candidates-generic.csv)
fi
# Community groups get priority
if test -f "$folder"/candidates.csv; then
candidates_files+=("$folder"/candidates.csv)
fi
done
php results/gen-elected.php --candidates-files "${candidates_files[*]}"