Created
October 30, 2022 19:40
-
-
Save begnini/30d0ee5250c810796001d8b5c608e526 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL_DATA="https://resultados.tse.jus.br/oficial/ele2022/545/dados-simplificados/br/br-c0001-e000545-r.json" | |
data=$(wget -q -O - $URL_DATA) | |
echo $data | jq -r ' | |
[50*"="], | |
[" ELEICOES 2022 - 2 turno"], | |
[50*"="], | |
(["% apurado", .pst, "atualizado", .hg]), | |
[50*"-"], | |
[" %", "Candidato"], | |
(.cand[] | | |
[.pvap, (.nm | (. + (" " * (20 - length)))), (.pvap | split(",")[0] | tonumber*"=")] | |
) | @tsv' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment