From bdef44ba80d771bf7c5e60e19dae5deaab6bf084 Mon Sep 17 00:00:00 2001 From: Marcos Marado Date: Sat, 19 May 2018 23:36:20 +0100 Subject: [PATCH] Adicionados scripts para automatizar validacoes Na raiz, correr scripts/*sh --- scripts/01-parlamento.sh | 32 + scripts/01/DetalheAudiencia.aspx?BID=99371 | 2894 ++++++++++++++++++++ scripts/01/embedplayer.min.js | 1 + scripts/README.md | 2 + 4 files changed, 2929 insertions(+) create mode 100755 scripts/01-parlamento.sh create mode 100644 scripts/01/DetalheAudiencia.aspx?BID=99371 create mode 100644 scripts/01/embedplayer.min.js create mode 100644 scripts/README.md diff --git a/scripts/01-parlamento.sh b/scripts/01-parlamento.sh new file mode 100755 index 0000000..48da037 --- /dev/null +++ b/scripts/01-parlamento.sh @@ -0,0 +1,32 @@ +#!/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 diff --git a/scripts/01/DetalheAudiencia.aspx?BID=99371 b/scripts/01/DetalheAudiencia.aspx?BID=99371 new file mode 100644 index 0000000..1a5248b --- /dev/null +++ b/scripts/01/DetalheAudiencia.aspx?BID=99371 @@ -0,0 +1,2894 @@ + + + + + + + + + + + + + + + + Detalhe de Audiência + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Bem-vindo à página oficial da Assembleia da República

+

Nota de apoio à navegação

+
+ Nesta página encontra 2 elementos auxiliares de + navegação: motor de busca (tecla de atalho 1) | + Saltar para o conteúdo (tecla de atalho 2) +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ +
+
+
+ + + + + + +
+
+ +
+ +
+ + + +
+ + + + + + + + +
+
+ + + + + + + + + + +
+
+ + +
+ +
+ + +
+
+ +
+ + + +
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ Comissão de Assuntos Constitucionais, Direitos, Liberdades e Garantias +
+
+
+ Audiência Parlamentar Nº 58-CACDLG-XII +
+
+
+ Assunto +
+ Reunião com a Relatora Especial das Nações Unidas para a Independência dos Juízes e Advogados +
+
+ Data da Audiência +
+ 2015-01-29 +
+
+ + Concedida por + Comissão + +
+ +
+ +
+ + +
+ Entidades recebidas +
+
+ + Dra. Gabriela Knaul, Relatora Especial das Nações Unidas para a Independência dos Juízes e Advogados +
+ + +
+ Dr. Marcelo Daher (Elemento do Gabinete da Relatora) +
+ +
+ Dr. Eduardo Pinto da Silva (em representação do Ministério dos Negócios Estrangeiros) +
+ + +
+ +
+ +
+ + + + + + +
+ +
+ +
+ Documentos associados à audiência +
+
+ +
+ +
+ CV - Dra. Gabriela Knaul + + [formato PDF] + +
+ +
+ +
+ +
+ Comunicado de Imprensa + + [formato PDF] + +
+ +
+ +
+ +
+ Enquadramento constitucional e legal da independência dos magistrados + + [formato PDF] + +
+ +
+ +
+ +
+ Código de Conduta dos Procedimentos Especiais + + [formato PDF] + +
+ +
+ +
+ +
+ Resolução 1994-41 que cria o mandato de Relator Especial + + [formato PDF] + +
+ +
+ +
+ +
+ Resolução 17-2 que renova e amplia o mandato de RE + + [formato PDF] + +
+ +
+ +
+ +
+ Relatório da visita da RE ao México - abril 2011 + + [formato PDF] + +
+ +
+ +
+ +
+ Relatório da visita da RE à Bulgária - maio 2012 + + [formato PDF] + +
+ +
+ +
+ +
+ Relatório da visita da RE à Roménia - junho 2012 + + [formato PDF] + +
+ +
+ +
+ +
+ Pedido de Reunião - MNE + + [formato PDF] + +
+ +
+ +
+ +
+
+ +
+ +
+ Links associados à audiência +
+
+ +
+ +
+ Vídeo da reunião + + +
+ +
+ +
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+
+
+ + +
+ + +
+ + + +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scripts/01/embedplayer.min.js b/scripts/01/embedplayer.min.js new file mode 100644 index 0000000..4bbc91a --- /dev/null +++ b/scripts/01/embedplayer.min.js @@ -0,0 +1 @@ +function playerReady(a){$(document).trigger("ON_PLAYER_READY",[{detail:a}])}"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b}),function(a,b,c,d){var e={get_playerembedID:function(a){var b=a.attr("id");return b===d&&(b=a.attr("class")),"plembed"+b},getDOMObjectPosition:function(a){var b={left:0,top:0,width:a.width?a.width:a.offsetWidth,height:a.height?a.height:a.offsetHeight};return b},endsWith:function(a,b){return-1!==a.indexOf(b,a.length-b.length)},get_flashvars:function(a,b){var c={swf_src:"http://canal.parlamento.pt/embed/arplayer.swf",user_id:"-1"};return a.hasOwnProperty("user_id")&&(c.user_id=a.user_id),"APPLE"===b||"ANDROID"===b?(a.hasOwnProperty("ipad_url")&&(c.ipad_url=a.ipad_url),a.hasOwnProperty("thumb")&&(c.poster=a.thumb),c):(a.hasOwnProperty("rtserver")?c.rtserver=a.rtserver:(a.hasOwnProperty("streamer")&&(c.streamer=a.streamer),a.hasOwnProperty("server_url")&&(c.streamer=a.server_url),a.hasOwnProperty("path")&&(c.file=a.path),a.hasOwnProperty("file")&&(c.file=a.file)),a.hasOwnProperty("livechannel")&&(c.livechannel=a.livechannel),a.hasOwnProperty("swf_src")&&(c.swf_src=a.swf_src),a.hasOwnProperty("autostart")?c.autostart=a.autostart:c.autostart="true",a.hasOwnProperty("sep")&&(c.sep_file=a.sep),a.hasOwnProperty("vo_streamer")&&(c.voice_over_streamer=a.vo_streamer),a.hasOwnProperty("vo_file")&&(c.voice_over_file=a.vo_file),a.hasOwnProperty("bufferlength")&&(c.bufferlength=a.bufferlength),a.hasOwnProperty("poster_frame")&&(c.image=a.poster_frame),a.hasOwnProperty("inpoint")&&(c.inpoint=a.inpoint),a.hasOwnProperty("outpoint")&&(c.outpoint=a.outpoint),c)}},f={load:function(c){if(c===d)return a.error("[load] Invalid parameters... check if the input info is valid"),this;var g=this;g.$elem=a(g);var h=a(b).data("playerType"),i=e.get_flashvars(c,h),j=f.player_id.call(g),k=g.$elem.find("#"+j);if(k&&k.remove(),"APPLE"===h)g.$elem.append('');else if("ANDROID"===h)g.$elem.append('');else{g.$elem.append('');var l={allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent",allownetworking:"all"},m={id:j,name:j,visibility:"visible"};swfobject.embedSWF(i.swf_src,j,"100%","100%","10","expressinstall.swf",i,l,m)}},onPlayerReady:function(b,d,e){try{b==e&&c.getElementById(b).sendEvent("UPDATE_SRC_JSON",JSON.stringify(d))}catch(f){a.error("[update_src] Something went wrong, when we try to update the source. MoreInfo:\n"+f)}},update_src:function(g){if(g===d)return a.error("[update_src] Invalid parameters... check if the input info is valid"),this;var h=this,i=f.player_id.call(h);if(!a("#"+i).length){var j={allowFullScreen:"true",allowScriptAccess:"always",wmode:"transparent",allownetworking:"all"},k=a(b).data("playerType"),l=e.get_flashvars(g,k),m={id:i,name:i,visibility:"visible"};return a(c).on("ON_PLAYER_READY",function(a,b){f.onPlayerReady.call(h,i,l,b.detail.id)}),h.$elem=a(h),"APPLE"===k?h.$elem.append(''):"ANDROID"===k?h.$elem.append(''):(h.$elem.append(''),swfobject.embedSWF(l.swf_src,i,"100%","100%","10","expressinstall.swf",{},j,m)),this}var k=a(b).data("playerType"),l=e.get_flashvars(g,k);if("APPLE"===k||"ANDROID"===k){var n=c.getElementById(i);n.src=l.ipad_url,n.load()}else try{c.getElementById(i).sendEvent("UPDATE_SRC_JSON",JSON.stringify(l))}catch(o){a.error("[update_src] Something went wrong, when we try to update the source. MoreInfo:\n"+o)}},stop:function(){var d=this,e=f.player_id.call(d),g=a(b).data("playerType");if("APPLE"===g||"ANDROID"===g){var h=c.getElementById(e);h.src=flashvars.ipad_url,h.pause()}else try{c.getElementById(e).sendEvent("PAUSE",{})}catch(i){a.error("[stop] Something went wrong, when we try to update the source. MoreInfo:\n"+i)}},mute:function(){var d=this,e=f.player_id.call(d),g=a(b).data("playerType");if("APPLE"===g||"ANDROID"===g){var h=c.getElementById(e);h.src=flashvars.ipad_url,h.prop("muted",!0)}else try{c.getElementById(e).sendEvent("MUTE",{})}catch(i){a.error("[mute] Something went wrong, when we try to update the source. MoreInfo:\n"+i)}},player_id:function(){var b=a(this);return e.get_playerembedID(b)}};a.fn.embedplayer=function(){var c=arguments[0],d="BROWSER",e=navigator.userAgent.toLowerCase();return-1!=e.indexOf("iphone")||-1!=e.indexOf("ipod")||-1!=e.indexOf("ipad")?d="APPLE":-1!==e.indexOf("android")&&(d="ANDROID"),a.data(b,"playerType",d),f[c]?f[c].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof c&&c?void a.error("Method "+c+" does not exist"):f.init.apply(this,arguments)},a.fn.embedplayer.options={}}(jQuery,window,document); \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..94b7425 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,2 @@ +Esta directoria contém um conjunto de scripts que ajudam a automatizar a +validação sobre se determinado incumprimento se mantém.