mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2024-11-26 21:19:29 +01:00
bash/ppfi: create qr-generator-wellBeingRegionElections2022.bash
This commit is contained in:
parent
ef5dd083cb
commit
2b175d9217
40
bash/piratepartyfinland/qr-generator-wellBeingRegionElections2022.bash
Executable file
40
bash/piratepartyfinland/qr-generator-wellBeingRegionElections2022.bash
Executable file
@ -0,0 +1,40 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Generates QR codes for wellbeing region elections 2022 or whatever they are
|
||||||
|
# in English
|
||||||
|
|
||||||
|
# TODO: apparently qrencode can read input from a file. Read how that works?
|
||||||
|
|
||||||
|
TARGETDIR=$(mktemp -d)
|
||||||
|
cd $TARGETDIR
|
||||||
|
|
||||||
|
echo "Creating to $TARGETDIR"
|
||||||
|
|
||||||
|
# Function to generate QRs based on our URL scheme
|
||||||
|
function generateQr () {
|
||||||
|
# $2 is first for the output as there are more regions than associations,
|
||||||
|
# avoids overwriting
|
||||||
|
# -H = 30 % damage allowing highest error correction
|
||||||
|
qrencode -l H -o $2.png "https://piraattipuolue.fi/yhdistykset/$1/aluevaaliehdokkaat-2022-$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Calling the function with associations and regions, they should be
|
||||||
|
# trivial to add.
|
||||||
|
generateQr "lapin-piraatit" "lappi"
|
||||||
|
generateQr "oulun-seudun-piraatit" "pohjois-pohjanmaa"
|
||||||
|
generateQr "oulun-seudun-piraatit" "kainuu"
|
||||||
|
generateQr "vaasan-piraatit" "pohjanmaa"
|
||||||
|
generateQr "vaasan-piraatit" "etela-pohjanmaa"
|
||||||
|
generateQr "satakunnan-piraatit" "satakunta"
|
||||||
|
generateQr "pirkanmaan-piraatit" "pirkanmaa"
|
||||||
|
generateQr "savo-karjalan-piraatit" "pohjois-karjala"
|
||||||
|
generateQr "hameen-piraatit" "kanta-hame"
|
||||||
|
generateQr "hameen-piraatit" "paijat-hame"
|
||||||
|
generateQr "uudenmaan-piraatit" "vantaa-kerava"
|
||||||
|
generateQr "kaakkois-suomen-piraatit" "etela-savo"
|
||||||
|
generateQr "varsinais-suomen-piraatit" "varsinais-suomi"
|
||||||
|
generateQr "kaakkois-suomen-piraatit" "kymenlaakso"
|
||||||
|
generateQr "kaakkois-suomen-piraatit" "etela-karjala"
|
||||||
|
generateQr "uudenmaan-piraatit" "lansi-uusimaa"
|
||||||
|
generateQr "uudenmaan-piraatit" "keski-uusimaa"
|
||||||
|
generateQr "uudenmaan-piraatit" "ita-uusimaa"
|
Loading…
Reference in New Issue
Block a user