fanta 1 month ago
parent 016e01d9d4
commit 43a1fd4d01

@ -73,13 +73,14 @@ function valencia {
do do
mainURL="https://dogv.gva.es/datos/$(date +"%Y/%m/%d")/pdf/dogv_$(date +"%Y")_$idDogv" mainURL="https://dogv.gva.es/datos/$(date +"%Y/%m/%d")/pdf/dogv_$(date +"%Y")_$idDogv"
mainURL="$(echo $mainURL)_es.pdf" mainURL="$(echo $mainURL)_es.pdf"
mainURLStatus=$(wget -NS "$mainURL" 2>&1 | grep "HTTP/" | awk '{print $2}')
let idDogv=$idDogv+1 let idDogv=$idDogv+1
sleep 1 sleep 1
done done
echo $idDogv > .lastDogv echo $idDogv > .lastDogv
wget -q $mainURL -O $pdfFile wget -q $mainURL -O $pdfFile
if [ "$(pdftotext $pdfFile - | grep -i -E -n -3 "$keyWords" | tee .cpds | wc -l)" = 0 ]; then echo "0 resultados"; rm -rf .cpds .boletin*; exit; else sendMail $mainURL $comunidad;fi if [ "$(pdftotext $pdfFile - | grep -i -E -n -3 "$keyWords" | tee .cpds | wc -l)" = 0 ]; then echo "0 resultados"; rm -rf .cpds dogv_* .boletin*; exit; else sendMail $mainURL $comunidad;fi
rm -rf .boletin* rm -rf dogv_* .boletin*
} }
function help { function help {

Loading…
Cancel
Save