|
|
@ -32,9 +32,16 @@ function testNotification() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function aragon {
|
|
|
|
function aragon {
|
|
|
|
echo "nada aún realizado. Aquí código para buscar en aragon"
|
|
|
|
|
|
|
|
comunidad="Aragon"
|
|
|
|
comunidad="Aragon"
|
|
|
|
pdfFile=".boletin$comunidad.pdf"
|
|
|
|
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 "<a .* title=\"Ver pdf del boletín completo.*</a>" -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 {
|
|
|
|
function barcelona {
|
|
|
|