Skip to content

Instantly share code, notes, and snippets.

@rtfpessoa
Last active July 5, 2021 09:43
Show Gist options
  • Save rtfpessoa/0fc17aadd491cc1029b29e30bb418d56 to your computer and use it in GitHub Desktop.
Save rtfpessoa/0fc17aadd491cc1029b29e30bb418d56 to your computer and use it in GitHub Desktop.
Verificação de disponibilidade para agendamento de vacina contra covid-19 (Portugal)
#!/usr/bin/env bash
while true
do
RESP="$(curl -fsS 'https://covid19.min-saude.pt/pedido-de-agendamento' \
-H 'Connection: keep-alive' \
-H 'Cache-Control: max-age=0' \
-H 'sec-ch-ua: " Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"' \
-H 'sec-ch-ua-mobile: ?0' \
-H 'Origin: https://covid19.min-saude.pt' \
-H 'Upgrade-Insecure-Requests: 1' \
-H 'DNT: 1' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36' \
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Sec-Fetch-Mode: navigate' \
-H 'Sec-Fetch-User: ?1' \
-H 'Sec-Fetch-Dest: document' \
-H 'Referer: https://covid19.min-saude.pt/pedido-de-agendamento' \
-H 'Accept-Language: en-GB,en;q=0.9,pt-PT;q=0.8,pt;q=0.7' \
--data-raw 'f_dia=10&f_mes=11&f_ano=1992' \
--compressed)"
MATCH="$(echo $RESP | grep 'Neste momento estão a ser vacinadas as pessoas com')"
if test -n "${MATCH}"
then
echo "$(date): Not yet"
else
echo ""
echo ""
echo ""
echo ""
echo ""
echo "$(date): GOGOGOGOGOGOGOGOGOGOGOGOGOGO"
echo ""
echo ""
echo ""
echo ""
echo ""
echo "Go go go Rodrigo go go go Rodrigo go go go" | espeak --stdin -a 200 -s 130 -v portugal
fi
sleep 60s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment