User:Danny van der Kleij/Free Wikileaks Pirate Radio

From XPUB & Lens-Based wiki
< User:Danny van der Kleij
Revision as of 23:56, 27 April 2011 by Danny van der Kleij (talk | contribs) (Created page with "=== Free Wikileaks Pirate Radio === Leakradio is a firefox plug-in that automatically takes the text of each wikileaks cable whenever you open these in your browser and reads it...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Free Wikileaks Pirate Radio

Leakradio is a firefox plug-in that automatically takes the text of each wikileaks cable whenever you open these in your browser and reads it out loud using google translator's text to speech software. The wikileaks servers have been at risk for a while now, and the discussion remains solely based on the web, however what is released on the web can always be re-released. Free wikileaks pirate radio takes this plug-in and uses it to broadcast these cables over a free radio frequency and thus liberating wikileaks from its medium, the Internet. Tune in and listen, make your own tape back up or even re-broadcast the signal.

// ==UserScript==
// @name           LeakRadio
// @namespace      pzwart3.wdka.hro.nl
// @include        http://translate.google.com/*
// @include				 http://wikileaks.ch/cable*
// @require				 http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
// ==/UserScript==

var ONESEC   = 1000 ;				
var ONETIME   = 10 * ONESEC ;		
var INTERVAL = 1 * ONETIME ;			


var textLength = 0;
var yoo = $("pre").next().next().html();
var textArray = new Array();

yoo = yoo.replace(/&(lt|gt);/g, function (strMatch, p1){
 		 	return (p1 == "lt")? "<" : ">";
 		});
var yoo2 = yoo.replace(/<\/?[^>]+(>|$)/g, "");

textLength = yoo2.length * 0.01;
var msg = "";
for (var i = 0; i < textLength; i++)
{
textArray[i] = yoo2.substring(i * 100, (i + 1)* 100);
}
//yoo2 = yoo2.substr(0,100);

//textArray = yoo2;
//alert(textArray[41].length);

var tabText = 0
var urlText="http://translate.google.com/translate_tts?q=";			
openTab();

function openTab(){
	if(tabText < textLength){
		var finalText= urlText.concat(textArray[tabText - 1]);	
		window.setTimeout(function(){	
			alert(textArray[tabText].length);			
			GM_openInTab(finalText);
			//window.location.reload();
			nextTab();
		},
		INTERVAL);
	}
}
function nextTab(){
openTab();
tabText++;
}