|
|
|
@ -56,6 +56,18 @@ function clamancha {
|
|
|
|
|
rm -rf .boletin*
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function extremadura {
|
|
|
|
|
comunidad="Extremadura"
|
|
|
|
|
pdfFile=".boletin$comunidad.pdf"
|
|
|
|
|
mainURL="https://doe.juntaex.es/ultimosdoe/mostrardoe.php?fecha=20250411&t=o"
|
|
|
|
|
pdfURL1="https://doe.juntaex.es"
|
|
|
|
|
pdfURL2=$(wget -q $mainURL -O - | grep -i -o "<a class=\"enlace_dis\".*Descargar el DOE completo en formato PDF" | grep -o -i "/pdfs.*\.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 madrid {
|
|
|
|
|
comunidad="Madrid"
|
|
|
|
|
pdfFile=".boletin$comunidad.pdf"
|
|
|
|
@ -93,6 +105,7 @@ function help {
|
|
|
|
|
echo "--aragon Alertas en Aragon"
|
|
|
|
|
echo "--barcelona Alertas en Barcelona"
|
|
|
|
|
echo "--clamancha Alertas en Castilla-La Mancha"
|
|
|
|
|
echo "--extremadura Alertas en Extremadura"
|
|
|
|
|
echo "--madrid Alertas en Madrid"
|
|
|
|
|
echo "--valencia Alertas en Valencia"
|
|
|
|
|
echo "--test Test de Notificación Email"
|
|
|
|
@ -106,6 +119,7 @@ function checkOpt {
|
|
|
|
|
if [ "$opt" = "--aragon" ]; then aragon; fi
|
|
|
|
|
if [ "$opt" = "--barcelona" ]; then barcelona; fi
|
|
|
|
|
if [ "$opt" = "--clamancha" ]; then clamancha; fi
|
|
|
|
|
if [ "$opt" = "--extremadura" ]; then extremadura; fi
|
|
|
|
|
if [ "$opt" = "--valencia" ]; then valencia; fi
|
|
|
|
|
if [ "$opt" = "--madrid" ]; then madrid; fi
|
|
|
|
|
}
|
|
|
|
|