// ==UserScript== // @name Lizard Feeder: Focus/Context + Word Cloud // @namespace feeds.mozilla.com // @include http://feeds.mozilla.com/ // ==/UserScript== /* * Multi-column (just add float left, line 29) * unsuccesful port to DOM mutation * Version 0.0.4 Feb 20, 2009 * Initial version by Andy Edmonds * This script is licensed under the MPL. * Excluding ReplaceAll prototype (license unstated) */ String.prototype.replaceAll = function(pcFrom, pcTo){ var i = this.indexOf(pcFrom); var c = this; while (i > -1){ c = c.replace(pcFrom, pcTo); i = c.indexOf(pcFrom); } return c; } var feedHack = { refresh: 300, timeout: false, counts: {}, words: {}, ignore: { 'the': true, 'a':true, 'of':true, 'bug': true, '1': true, '2':true, 'mozilla': true, 'rt': true, 'its':true, 'doesnt': true, 'it':true, 'is':true, 'in': true, 'at': true, 'and':true, 'com':true, 'it':true, 'from':true, 'when':true, 'for':true, 'tinyurl':true, 'to': true, '0':true, 'and':true, 'bit':true, 'ly':true, 'https':true, 'on':true, 'no':true, 'do':true,'you':true,'all':true, 'with':true, 'how':true, 'be':true, 'like':true, 'will':true, 'me':true, 'my':true, 'but':true, 'can': true, 'as':true, 'or':true, 'not':true, 'are':true, 'does':true, 'if':true, 'that':true, 'has':true, 'an':true, 'also':true, 'www':true } }; feedHack.init = function init() { $ = unsafeWindow.jQuery; $("li.filter").css("opacity", .5); $("li.filter").css("font-size", this.inactiveEm + 'em'); $("#intro").css("z-index", 20); $("#content").append("
"); window.setInterval(this.feedHack, this.refresh); } // From http://diveintogreasemonkey.org/patterns/add-css.html feedHack.addGlobalStyle = function (css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } feedHack.feedHack = function () { $ = unsafeWindow.jQuery; var text; for(var type in feedHack.counts) { feedHack.counts[type]=0; $("li.filter.group-" + type).css("opacity", 1); } $("li.entry:visible").each( function( offset ){ //console.log(this); if($(this).css("maxWidth") != '360px') { node = this.getElementsByTagName("A")[0].innerHTML; node = node.replaceAll("http://",""); node = node.replaceAll("/"," "); node = node.replaceAll("\\"," "); node = node.replaceAll("."," "); node = node.replaceAll("."," "); node = node.replaceAll("."," "); node = node.replaceAll(","," "); node = node.replaceAll("- "," "); node = node.replaceAll(" -"," "); node = node.replaceAll("_"," "); node = node.replaceAll(":"," "); node = node.replaceAll("'"," "); node = node.replaceAll('"',' '); node = node.replaceAll('"',' '); node = node.replaceAll(')',''); node = node.replaceAll('(',''); node = node.replaceAll('!',''); node = node.replaceAll('?',''); node = node.replaceAll('>',''); node = node.replaceAll('<',''); node = node.replaceAll('[',''); node = node.replaceAll(']',''); node = node.replaceAll(';',''); node = node.replaceAll('@',''); var nodes = node.split(" "); for(var i =0;i