Skip to content

Instantly share code, notes, and snippets.

@masterofpun
Created May 18, 2015 11:09
Show Gist options
  • Save masterofpun/a2c817f9af3b3e935825 to your computer and use it in GitHub Desktop.
Save masterofpun/a2c817f9af3b3e935825 to your computer and use it in GitHub Desktop.
/u/PorridgeTP's script
// ==UserScript==
// @name Polite Text
// @version 1.2
// @include http://tagpro-*.koalabeast.com:*
// @include http://tangent.jukejuice.com:*
// @include http://maptest*.newcompte.fr:*
// @author Witch
// ==/UserScript==
var politeMap = {
'fuck': 'love',
'fucks': 'things',
'fucked': 'messed',
'fucking': 'loving',
'shitting': 'hugging',
'shit': 'sorry',
'shits': 'sits',
'shitface': 'pal',
'shitfaced': 'happy',
'bitch': 'lady',
'bitches': 'ladies',
'bitchy': 'lovely',
'hate': 'care about',
'hates': 'cares about',
'suck': 'win',
'sucks': 'wins',
'fucker': 'friend',
'fuckers': 'friends',
'nigger': 'juker',
'niggers': 'jukers',
'nig': 'juke',
'nigs': 'jukes',
'nigga':' juker',
'niggas': 'jukers',
'niggah': 'juker',
'niggahs': 'jukers',
'dick': 'bunny',
'dicks': 'bunnies',
'pussy': 'kitty',
'puss': 'kitty',
'pussies': 'kitties',
'asshole': 'angel',
'assholes': 'angels',
'ass': 'posterior',
'asses': 'posteriors',
'fag': 'nice person',
'fags': 'nice people',
'faggot': 'nice person',
'faggots': 'nice people',
'fagit': 'nice person',
'fagits': 'nice people',
'fgt': 'nice person',
'fgts': 'nice people',
'fuckface': 'friend',
'cunt': 'pro',
'cunts': 'pros',
'cuntface': 'buddy',
'thundercunt': 'BFF',
'motherfucker': 'pal',
'motherfuckers': 'pals',
'mofo': 'pal',
'mofos': 'pals',
'jew': 'buddy',
'jews': 'buddies',
'kike': 'friend',
'gook': 'friend',
'chink': 'friend',
'bg': 'gg',
'jewish': 'nice',
'shithead': 'pal',
'noob': 'newbie',
'fucktard': 'fun person',
'fucktards': 'fun people',
'dicklicker': 'nice person',
'dicklickers': 'nice people',
'clit': 'bunny',
'clits': 'bunnies'
};
function addToTagproReady(fn) {
if (typeof tagpro !== "undefined") {
tagpro.ready(fn);
} else {
setTimeout(function() {
addToTagproReady(fn);
}, 0);
}
}
function getPoliteText(message) {
var politeText = message;
var words = message.match(/\S+/g); // split up text based on whitespace
for (var index in words) {
var word = words[index].replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~\[\]()\+\'\"\\]/g,''); // strip punctuation
var lowerWord = word.toLowerCase();
if (lowerWord in politeMap) {
politeText = politeText.replace(word, politeMap[lowerWord]);
}
}
return politeText;
}
addToTagproReady(function() {
var baseEmit = tagpro.socket.emit;
tagpro.socket.emit = function(emitType, data) {
if (emitType === 'chat') {
var politemsg = getPoliteText(data['message']);
return baseEmit(emitType, { message:politemsg, toAll:data['toAll'] });
} else {
return baseEmit(emitType, data);
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment