Created
March 19, 2019 08:21
-
-
Save Flower7C3/34e670f1ec91192662618f0f26ee4e4a to your computer and use it in GitHub Desktop.
Add some vulgarity to page #fun
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:{var%20whitespace%20=%20"-\/|.,!:;'\"%20\t\n\r{}[]()";var%20stack%20=%20[];var%20curNIndex%20=%200;var%20curNode%20=%20null;var%20curIndex%20=%20-1;var%20state%20=%201;var%20lastword%20=%20'';String.prototype.startsWith%20=%20function(prefix)%20{return%20this.indexOf(prefix)%20===%200;};String.prototype.endsWith%20=%20function(suffix)%20{return%20this.match(suffix+"$")%20==%20suffix;};/*%20Nie%20moge%20tak%20robi%C4%87%20niestety%20*/function%20kurwizeLink(url){if(url.startsWith('javascript:'))return%20url;%20/*%20chyba%20niewiele%20moge%20zrobic%20kurwa%20*/if(url.startsWith('#'))return%20url;if(url.startsWith('https://www.google.pl'))return%20url;%20/*%20no,%20bo%20kurwa,%20bez%20jaj%20;p%20*/var%20base%20=%20'';if(!url.startsWith('http')){base%20=%20location.protocol%20+%20"://"%20+%20location.host;if(!url.startsWith('/')){var%20pathname%20=%20location.pathname;base%20+=%20pathname.substring(0,%20pathname.lastIndexOf('/'));}}return%20'http://kurwa.keraj.net/?url='+base+url;};function%20nextLetter(){if(curNode==null)return%20null;if(curIndex%20>=%20curNode.data.length){curNode%20=%20stack[++curNIndex];curIndex%20=%20-1;if(curNode==null)return%20null;}curIndex++;if(curIndex%20>=%20curNode.data.length){return%20'%20';}return%20curNode.data[curIndex];};function%20nextAfterWord(){/*%20lastword%20=%20'';%20*//*%20szukamy%20poczatku%20kurwa%20wyrazu%20*/dupa:while(true){do%20{var%20let%20=%20nextLetter();if(let==null)return%20false;}%20while(whitespace.indexOf(let)!=-1);if(state==1){/*%20byliszmy%20na%20poczatku,%20teraz%20kurwa%20bedziemy%20szukac%20konca%20wyrazu%20*/state%20=%202;return%20true;};state%20=%203;var%20starting%20=%20curIndex;do%20{var%20let%20=%20nextLetter();if(let==null)return%20false;if(state==1)continue%20dupa;}%20while(whitespace.indexOf(let)==-1);/*%20ostatni%20wyraz,%20moze%20sie%20kurwa%20przydac%20pozniej%20zeby%20nasz%20algorytm%20byl%20bardziej%20inteligentny%20*//*%20trza%20to%20jeszcze%20kurwa%20usprawnic%20*/lastword%20=%20curNode.data.substr(starting,curIndex-starting);return%20true;}};function%20putHere(text){if(curNode==null)return;/**%20oj,%20trzeba%20to%20kurwa%20fixn%C4%85%C4%87%20kiedy%C5%9B%20*/curNode.data%20=%20curNode.data.substr(0,curIndex)%20+%20(state!=2?'%20':'')%20+text+%20(state==2?'%20':'')%20+%20curNode.data.substr(curIndex);curIndex%20+=%20text.length%20+%202;};function%20replaceLast(text)%20{var%20s2%20=%20curNode.data.substr(curIndex);curIndex%20-=%20lastword.length;var%20s1%20=%20curNode.data.substr(0,curIndex);curIndex+=%20text.length;curNode.data%20=%20s1%20+%20text%20+%20s2;}/**%20rekurencyjnie%20szukamy%20tylko%20tekstu%20kurwa%20*/function%20przelec(node){if(typeof%20node%20!=%20"object"%20||%20typeof%20node.childNodes%20!=%20"object")return;var%20children%20=%20node.childNodes;for%20(var%20i%20=%200;%20i%20<%20children.length;%20i++){var%20child%20=%20children[i];/*%20nie%20IFRAME,%20bo%20sie%20moze%20kurwa%20crashn%C4%85%C4%87,%20nie%20SCRIPT...%20wiadomo,%20nie%20PRE%20-%20bo%20to%20moze%20byc%20kurwa%20kod%20%C5%BAr%C3%B3d%C5%82owy...%20chocia%C5%BC%20mo%C5%BCe%20fajnie%20by%20by%C5%82o%20widzie%C4%87%20co%C5%9B%20w%20stylu%20std:kurwa:cout%20*/if(child.nodeType==1%20&&%20child.tagName!="SCRIPT"%20&&%20child.tagName!="IFRAME"%20/*&&%20child.tagName!="PRE"*/){przelec(child);};if(child.nodeType==3){stack.push(child);};if(child.tagName=="A"){%20/*%20child.href=kurwizeLink(child.href+'');%20*/};};};if((typeof%20DONT_KURWA)%20===%20"undefined"%20||%20!DONT_KURWA)%20{przelec(document.body);curNode%20=%20stack[0];var%20i%20=%20Math.floor(Math.random()*9);var%20forpe%20=%20window.location.href.indexOf("4programmers")%20>%20-1;/*%20a%20tak%20se%20sprawdzimy%20:D%20if(forpe){while(nextAfterWord())%20{var%20word%20=%20'Adam%20Boduch';var%20rnd%20=%20Math.random()%20*%205;if(rnd<1)word%20=%20"Adam";else%20if(rnd<2)%20word%20=%20"Boduch";else%20if(rnd<3)word%20=%20"klacze";replaceLast(word);}return;}%20*/while(nextAfterWord()){if(i--<=0){if(lastword=='na')continue;if(lastword=='do')continue;if(lastword=='jak')continue;if(forpe)%20{if(lastword=='i')continue;if(lastword=='o')continue;if(lastword=='w')continue;if(lastword=='z')continue;if(lastword=='a')continue;if(lastword=='u')continue;if(lastword=='si%C4%99')continue;if(lastword.startsWith('niekt'))continue;if(lastword.startsWith('r%C3%B3%C5%BCn'))continue;replaceLast('Adam%20Boduch');}%20else%20{if(lastword=='nie')continue;if(lastword=='kurwa')continue;putHere('kurwa');}var%20i%20=%202%20+%20Math.floor(Math.random()*8);};};}%20else%20{alert("Ta%20strona%20nie%20lubi%20by%C4%87%20wulgaryzowana%20:(");}}%20void%200; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var whitespace = "-\/|.,!:;'\" \t\n\r{}[]()"; | |
var stack = []; | |
var curNIndex = 0; | |
var curNode = null; | |
var curIndex = -1; | |
var state = 1; | |
var lastword = ''; | |
String.prototype.startsWith = function (prefix) { | |
return this.indexOf(prefix) === 0; | |
}; | |
String.prototype.endsWith = function (suffix) { | |
return this.match(suffix + "$") == suffix; | |
};/* Nie moge tak robi%C4%87 niestety */ | |
function nextLetter() { | |
if (curNode == null) return null; | |
if (curIndex >= curNode.data.length) { | |
curNode = stack[++curNIndex]; | |
curIndex = -1; | |
if (curNode == null) return null; | |
} | |
curIndex++; | |
if (curIndex >= curNode.data.length) { | |
return ' '; | |
} | |
return curNode.data[curIndex]; | |
}; | |
function nextAfterWord() {/* lastword = ''; *//* szukamy poczatku kurwa wyrazu */ | |
dupa:while (true) { | |
do { | |
var let = nextLetter(); | |
if (let == null) return false; | |
} while (whitespace.indexOf(let) != -1); | |
if (state == 1) {/* byliszmy na poczatku, teraz kurwa bedziemy szukac konca wyrazu */ | |
state = 2; | |
return true; | |
} | |
;state = 3; | |
var starting = curIndex; | |
do { | |
var let = nextLetter(); | |
if (let == null) return false; | |
if (state == 1) continue dupa; | |
} while (whitespace.indexOf(let) == -1);/* ostatni wyraz, moze sie kurwa przydac pozniej zeby nasz algorytm byl bardziej inteligentny *//* trza to jeszcze kurwa usprawnic */ | |
lastword = curNode.data.substr(starting, curIndex - starting); | |
return true; | |
} | |
}; | |
function putHere(text) { | |
if (curNode == null) return; | |
/** oj, trzeba to kurwa fixn%C4%85%C4%87 kiedy%C5%9B */curNode.data = curNode.data.substr(0, curIndex) + (state != 2 ? ' ' : '') + text + (state == 2 ? ' ' : '') + curNode.data.substr(curIndex); | |
curIndex += text.length + 2; | |
}; | |
function replaceLast(text) { | |
var s2 = curNode.data.substr(curIndex); | |
curIndex -= lastword.length; | |
var s1 = curNode.data.substr(0, curIndex); | |
curIndex += text.length; | |
curNode.data = s1 + text + s2; | |
} | |
/** rekurencyjnie szukamy tylko tekstu kurwa */function przelec(node) { | |
if (typeof node != "object" || typeof node.childNodes != "object") return; | |
var children = node.childNodes; | |
for (var i = 0; i < children.length; i++) { | |
var child = children[i];/* nie IFRAME, bo sie moze kurwa crashn%C4%85%C4%87, nie SCRIPT... wiadomo, nie PRE - bo to moze byc kurwa kod %C5%BAr%C3%B3d%C5%82owy... chocia%C5%BC mo%C5%BCe fajnie by by%C5%82o widzie%C4%87 co%C5%9B w stylu std:kurwa:cout */ | |
if (child.nodeType == 1 && child.tagName != "SCRIPT" && child.tagName != "IFRAME" /*&& child.tagName!="PRE"*/) { | |
przelec(child); | |
} | |
; | |
if (child.nodeType == 3) { | |
stack.push(child); | |
} | |
; | |
} | |
; | |
}; | |
if ((typeof DONT_KURWA) === "undefined" || !DONT_KURWA) { | |
przelec(document.body); | |
curNode = stack[0]; | |
var i = Math.floor(Math.random() * 9); | |
var forpe = window.location.href.indexOf("4programmers") > -1;/* a tak se sprawdzimy :D if(forpe){while(nextAfterWord()) {var word = 'Adam Boduch';var rnd = Math.random() * 5;if(rnd<1)word = "Adam";else if(rnd<2) word = "Boduch";else if(rnd<3)word = "klacze";replaceLast(word);}return;} */ | |
while (nextAfterWord()) { | |
if (i-- <= 0) { | |
if (lastword == 'na') continue; | |
if (lastword == 'do') continue; | |
if (lastword == 'jak') continue; | |
if (forpe) { | |
if (lastword == 'i') continue; | |
if (lastword == 'o') continue; | |
if (lastword == 'w') continue; | |
if (lastword == 'z') continue; | |
if (lastword == 'a') continue; | |
if (lastword == 'u') continue; | |
if (lastword == 'si%C4%99') continue; | |
if (lastword.startsWith('niekt')) continue; | |
if (lastword.startsWith('r%C3%B3%C5%BCn')) continue; | |
} else { | |
if (lastword == 'nie') continue; | |
if (lastword == 'kurwa') continue; | |
putHere('kurwa'); | |
} | |
var i = 2 + Math.floor(Math.random() * 8); | |
} | |
; | |
} | |
; | |
} else { | |
alert("Ta strona nie lubi by%C4%87 wulgaryzowana :("); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment