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

View File

@@ -1,5 +1,15 @@
#!/bin/bash
council_name=boroondara-city-council
mkdir -p html
wget https://www.vec.vic.gov.au/results/2024-council-election-results -O html/lga_list.html
wget https://www.vec.vic.gov.au/voting/2024-local-council-elections/$council_name/results -O $council_name
IFS=$'\n'
lgas=$(grep 'href="/voting/.*/results"' html/lga_list.html)
for lga in $lgas ; do
lga=$(sed 's|.*href="|https://www.vec.vic.gov.au|' <<< $lga)
lga=$(sed 's|">.*||' <<< $lga)
file=$(sed 's|.*elections/||' <<< $lga | sed s'|/results||')
wget $lga -O html/$file
done