MySpace cuss word blocker

By Tyler Charlesworth Last update Jan 15, 2006 — Installed 1,621 times.
// ==UserScript== 
// @name          MySpace cuss word blocker
// @namespace     http://www.tyworks.net
// @description   Censors bad words on myspace
// @include       http://*.myspace.com
// ==/UserScript== 
//
//
//
//
//
//
//
//
//      This code turns -most- cuss words into *s.
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//      WARNING: Code contains words that many consider offensive. If you do not wish to see them,
//               Don't scroll down.
//              
//               ^_^
//
//
//
//
//
//


(function() {
  var replacements, regex, key, textnodes, node, s; 

  replacements = {
  
  //case sens
  
  
  //safe replace
  
  "Pussy cat": "***** ***",
  "Jackass": "*******",

  
  
  // bad replace 
   "Goddamn": "*******",
  "God damn": "*** ****",
 
  
    "Son of a bitch": "*** ** * *****",
   "Bitchy": "******",
   "Bitched": "*******",
   "Bitching" : "********",
    "Ass hole": "*** ****",
    "What the hell": "What the heck", 
    " Tits ": " **** ", 
    " Tit ": " *** ",
    " Pussy ": " ***** ",
    " Damnit": " ******", 
    "Bastard": "*******", 
    " Cunt": " ****", 
    "Dickhead": "********",   
    "Ballsack": "********",  
    " ass ": " *** ", 
    "Faggot": "******",
    "Niggaz": "******", 
    "Nigger": "******", 
    "Nigga": "*****",
    "Lmao": "Rofl",
    "Lmfao": "Rofl",
    
 //all caps
    "SON OF A BITCH": "*** ** * *****",
    "GOD DAMN": "*** ****",
    "GODDAMN": "*******",
     "BITCHY": "******",
	 "BITCHED": "*******",
	 "BITCHING" : "********",
    "LMAO": "ROFL",
    "LMFAO": "ROFL",
    "WHAT THE HELL": "WHAT THE HECK", 
      " TITS ": " ***** ",  
      " TIT ": " *** ",
    " PUSSY ": " ***** ",
    "BASTARD": "*******", 
    " CUNT": " ****",
    "SON OF A BITCH": "*** ** * *****",
    "DICKHEAD": "********",   
    "BALLSACK": "********",
    "ASSHOLE": "*******",
    "ASS HOLE": "*** ****",
    "ASS-HOLE": "*** ****",  
    " ASS ": " *** ", 
    "FAGGOT": "******",
    "NIGGAZ": "******", 
    "NIGGER": "******", 
    "NIGGA": "*****",

    
    //punctuation
    
    "Shit!": "****!", 
    " Tits!": " ****!",    
     " Tit!": " ***!",
    "Cunt!": "****!", 
    " Ass!": " ***!", 
    
    "Shit,": "****, ", 
    " Tits,": " ****,",  
    " Tit,": " ***,", 
    "Cunt,": "****,", 
    " Ass,": " ***,",
    
        
    
    // trump cards

     "Asshole": "*******",
     "Ass-hole": "*** ****", 
     "Motherfucker": "************",
     "Fucker": "******",
     "Fuck": "****",
     "FUCK": "****",
     "Shit": "****",
     "Bitches": "*******",
	 "Bitch": "****",
	 "Damn": "****",
	 "BITCHES": "*******",
	 "BITCH": "*****",
	 "DAMN": "****",

    
 }; 
 regex = {}; 
for (key in replacements) { 
    regex[key] = new RegExp(key, 'g'); 
} 

textnodes = document.evaluate( "//body//text()", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); 

for (var i = 0; i < textnodes.snapshotLength; i++) { 
    node = textnodes.snapshotItem(i); 
    s = node.data; 
    for (key in replacements) { 
        s = s.replace(regex[key], replacements[key]); 
    } 
    node.data = s; 
} 

  var replacements, regex, key, textnodes, node, s; 

  replacements = {

   //not case sense

  //safe replace
  "pussy cat": "***** ***",
  "jackass": "*******",

  
  // bad replace 
  "goddamn": "*******",
  "god damn": "*** ****",
  "son of a bitch": "*** ** * *****",
  "bitchy": "******",
  "bitched": "*******",
  "bitching" : "********",
     
    "ass hole": "*** ****",
    "what the hell": "what the heck", 
    " tits ": " *** ",  
    " tit ": " *** ",
    " pussy ": " ***** ", 
    "bastard": "*******", 
    " cunt": " ****",
    "dickhead": "********",   
    "ballsack": "********",
    "asshole": "*******",
    "ass hole": "*** ****",
    "ass-hole": "*** ****",  
    " ass ": " *** ", 
    "faggot": "******",
    "niggaz": "******", 
    "nigger": "******", 
    "nigga": "*****",
    "lmao": "rofl",
    "lmfao": "rofl",
 
    
    //punctuation
    
    " tits!": " ****!",    
    " tit!": " ***!", 
    "cunt!": "****!",  
    " ass!": " ***!", 
     
    " tits,": " ****,",
    " tit,": " ***,",
    "cunt,": "****,",  
    " ass,": " ***,",
      
    
    // trump cards
     "asshole": "*******",
     "ass-hole": "*** ****",
     "motherfucker": "************",
     "fucker": "******",
     "fuck": "****",
     "fuck": "****",
     "shit": "****",
     "bitches": "*******",
	 "bitch": "*****",
	 "damn": "****",

 }; 

regex = {}; 
for (key in replacements) { 
    regex[key] = new RegExp(key, 'gi'); 
} 

textnodes = document.evaluate( "//body//text()", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); 

for (var i = 0; i < textnodes.snapshotLength; i++) { 
    node = textnodes.snapshotItem(i); 
    s = node.data; 
    for (key in replacements) { 
        s = s.replace(regex[key], replacements[key]); 
    } 
    node.data = s; 
} 

})();