|
|
|
@ -87,6 +87,18 @@ function madrid {
|
|
|
|
|
rm -rf .boletin*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function paisvasco {
|
|
|
|
|
comunidad="Euskadi"
|
|
|
|
|
pdfFile=".boletin$comunidad.pdf"
|
|
|
|
|
mainURL="https://www.euskadi.eus/web01-bopv/es/bopv2/datos/Ultimo.shtml"
|
|
|
|
|
pdfURL1="https://www.euskadi.eus/web01-bopv/es/bopv2/datos/"
|
|
|
|
|
pdfURL2=$(wget -q $mainURL -O - | grep -i -o "<li class=\"formatoPdf\"><a href=.*.pdf" | grep -i -o "20.*pdf")
|
|
|
|
|
pdfURL="${pdfURL1}${pdfURL2}"
|
|
|
|
|
wget -q $pdfURL -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 $pdfURL $comunidad;fi
|
|
|
|
|
rm -rf .boletin*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function valencia {
|
|
|
|
|
# boletín experimental actualmente
|
|
|
|
|
comunidad="Valencia"
|
|
|
|
@ -117,6 +129,7 @@ function help {
|
|
|
|
|
echo "--extremadura Alertas en Extremadura"
|
|
|
|
|
echo "--madrid Alertas en Madrid"
|
|
|
|
|
echo "--valencia Alertas en Valencia"
|
|
|
|
|
echo "--paisvasco Alertas en País Vasco"
|
|
|
|
|
echo "--test Test de Notificación Email"
|
|
|
|
|
echo -e "--help Muesta la ayuda\n"
|
|
|
|
|
}
|
|
|
|
@ -131,6 +144,7 @@ function checkOpt {
|
|
|
|
|
if [ "$opt" = "--extremadura" ]; then extremadura; fi
|
|
|
|
|
if [ "$opt" = "--valencia" ]; then valencia; fi
|
|
|
|
|
if [ "$opt" = "--madrid" ]; then madrid; fi
|
|
|
|
|
if [ "$opt" = "--paisvasco" ]; then paisvasco; fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
|