From 6cdc427ea666fe401be9de3d1361bfaaf570b797 Mon Sep 17 00:00:00 2001 From: Pseudavid Date: Mon, 14 Apr 2025 19:16:30 +0200 Subject: [PATCH] =?UTF-8?q?Nueva=20comunidad=20aut=C3=B3noma:=20Arag=C3=B3?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cpdAlerts.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cpdAlerts.sh b/cpdAlerts.sh index 3371b60..eb3ae1e 100755 --- a/cpdAlerts.sh +++ b/cpdAlerts.sh @@ -32,9 +32,16 @@ function testNotification() { } function aragon { - echo "nada aún realizado. Aquí código para buscar en aragon" comunidad="Aragon" pdfFile=".boletin$comunidad.pdf" + mainURL="https://www.boa.aragon.es/PABOA/automa.htm" + todayURL=$(wget -q $mainURL -O - | grep -i -o "document.location.href=.*" | grep -Po '(?<=document.location.href=")[^"]*(?=")') + pdfURL1="https://www.boa.aragon.es/cgi-bin/EBOA/" + pdfURL2=$(wget -q $todayURL -O - | grep -i -o "" -m 1 | grep -o -i "href=\".*type=pdf\"" | grep -Po '(?<=href=")[^"]*(?=")') + 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 barcelona {