Last active
October 19, 2021 16:23
-
-
Save victor-oliveira1/b5477480249a91164bec997bbc199427 to your computer and use it in GitHub Desktop.
Informa as doses disponíveis para vacinação contra COVID em São Bernardo do Campo
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
#!/usr/bin/env bash | |
# Informa as doses disponíveis para vacinação contra COVID em SBC - SP | |
# Necessário instalar o programa jq | |
# Exemplos: | |
# - getVacina 1 | |
# - getVacina 2 ASTRAZENECA | |
# - getVacina 3 | |
# Victor Oliveira <victor.oliveira@gmx.com> | |
getVacina() { | |
local DOSE="${1}" | |
local VACINA="${2}" | |
curl -s 'https://vacinacovid.saobernardo.sp.gov.br/VacinaSBCProd/servlet/inicial' |\ | |
grep -Eo "'{.*}'" |\ | |
cut -d\' -f2 |\ | |
jq -j ".vPUBLICOALVOVACINAID_D${DOSE}_Values" |\ | |
jq .v |\ | |
grep "${VACINA}" |\ | |
cut -d\" -f2 |\ | |
grep -E '^[A-Z]' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment