rnid/scripts/01-parlamento.sh

33 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Incumprimentos: Vídeos disponibilizados em WMV, Canal Parlamento em Flash
## a) Vídeos disponibilizados em WMV
wget http://www.parlamento.pt/ActividadeParlamentar/Paginas/DetalheAudiencia.aspx?BID=99371 -o /dev/null -O - | \
grep -v "formDigestElement.value = '"|grep -v clientServerTimeDelta|grep -v __VIEWSTATE| \
grep -v __EVENTVALIDATION|grep -v __REQUESTDIGEST|grep -v ^\<\!-- |sed 's/target=\"_new.*//g' > tmp
a=$(diff tmp scripts/01/DetalheAudiencia.aspx?BID=99371 |wc -l)
# Se $a for 0, então o incumprimento mantém-se
rm tmp
## b) Canal Parlamento em Flash
b=0; # 0 significa que incumprimento mantém-se
test $(wget http://www.canal.parlamento.pt/ -o /dev/null -O -|grep embedplayer.min.js|wc -l) -eq "1" \
&& (
wget http://www.canal.parlamento.pt/scripts/embedplayer.min.js -o /dev/null;
test "$(diff embedplayer.min.js scripts/01/embedplayer.min.js|wc -l)" -eq "0" || b=1;
rm embedplayer.min.js;
) || b=2
## resultados:
if [ ! "$a" -eq "0" ]; then
echo "Incumprimento 'a' (videos em wmv) pode estar resolvido.";
fi
if [ ! "$b" -eq "0" ]; then
echo "Incumprimento 'b' (flash no canal paralamento) pode estar resolvido ($b).";
fi
if [ $((a + b)) -eq "0" ]; then
echo "parlamento: incumprimento mantém-se, actualizar README";
fi