Skip to content

Instantly share code, notes, and snippets.

@nikolas
Created September 7, 2012 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikolas/3667229 to your computer and use it in GitHub Desktop.
Save nikolas/3667229 to your computer and use it in GitHub Desktop.
js functions for fortchan.org
function d() {
return Math.random() >= 0.5;
}
function myLoop() {
var interval = setInterval(function() {
var str = '`~=~`~=+=~`~``~=~`~-+==~`~-_-~`:';
if ($('body')) {
var str = $('body').text();
}
var newStr = '';
for (var i = 0, len = str.length; i < len; i++) {
var ch = str[i];
if (d()) {
newStr += (ch + ' ');
} else {
newStr += ch;
}
}
$.post('/branches', { 'leaf[content]': newStr });
}, 500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment