From 552ac396e71ff4eb06f2391db25cdb05583493b9 Mon Sep 17 00:00:00 2001 From: Marcos Marado Date: Sun, 20 May 2018 15:25:08 +0100 Subject: [PATCH] scripts: RTP - novo teste --- scripts/04-rtp.sh | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 scripts/04-rtp.sh diff --git a/scripts/04-rtp.sh b/scripts/04-rtp.sh new file mode 100755 index 0000000..d91fcea --- /dev/null +++ b/scripts/04-rtp.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# https://www.iefp.pt/ - não cumpre WCAG 2.0 AA +# RTP - flash e WMV + +# http://media.rtp.pt/empresa/utilizacao/termos-e-condicoes/ + +flash=$(wget http://media.rtp.pt/empresa/utilizacao/termos-e-condicoes/ --user-agent="Mozilla/5.0 Gecko/20100101 Firefox/21.0" -o /dev/null -O -|grep -i flash|wc -l) +wmv=$(wget http://media.rtp.pt/empresa/utilizacao/termos-e-condicoes/ --user-agent="Mozilla/5.0 Gecko/20100101 Firefox/21.0" -o /dev/null -O -|grep -i windows|wc -l) + +mudancas=0; +if [ "$flash" -eq "0" ]; then + echo "RTP: Flash: incumprimento pode já não existir"; + mudancas=1; +fi +if [ "$wmv" -eq "0" ]; then + echo "RTP: WMV: incumprimento pode já não existir"; + mudancas=1; +fi + +## 20/05/2018: - several images without an alt attribute: +if [ "$mudancas" -eq "0" ]; then + echo "RTP: Incumprimento mantém-se, a actualizar o README (faça um git diff, valide, e commit!)"; + while IFS='' read -r line || [[ -n "$line" ]]; do + test $(echo "$line"|grep -v rtp|wc -l) -eq "1" \ + && echo "$line" \ + || (h=$(echo "$line"|cut -d\| -f1-4); t=$(echo "$line"|cut -d\| -f6-); echo "$h| $(date +%Y/%m/%d) |$t"); + done < README.md > new + mv new README.md +fi