Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Every thread on the front page just got saged

Name: Anonymous 2011-01-23 13:18

nice. i lol'd.

Name: Anonymous 2011-01-23 13:58

it motivated me to write a userscript, took me waaay too long to
figure out that you can create one by copying an existing one and
renaming it "whatever.user.js". then simply edit it to
do whatever and open it with ctrl-o (at least in chromium).

now that i know how to do it, the rest is easy... no more cancer!

Name: Anonymous 2011-01-23 14:25

>>2
nice.

Name: Anonymous 2011-01-23 14:25

>>2
I lol'd

Name: Anonymous 2011-01-23 17:22


// ==UserScript==
// @name          /prog/ commander
// @version       2011 PRO DELUXE
// @namespace     tag:killitwithFIRE
// @description   YOU'RE DEAD TO ME
// @include       http://dis.4chan.org/prog/*;
// @include       http://dis.4chan.org/read/prog/*;
// ==/UserScript==

/* save as prog.user.js and open with ctrl-o
**/

// if we're on the main page, loop over every thread
if ( window.location.pathname == '/prog/')
{
  var threads = document.getElementsByClassName('thread');
  for (var i = 0; i < threads.length; i++) {
    var thread = threads[i];
  }
}

// in any case, loop over posts:
var posts = document.getElementsByClassName('post');
for (var i = 0; i < posts.length; i++)
{
  var contents = posts[i].getElementsByTagName('blockquote')[0];
  if ( contents.innerHTML.match(/<.*?>/gi).length > 100 )
  {
    contents.innerHTML = '<span style="color:red;font-weight:bold">cancer</span>'
  }
}

Name: Anonymous 2011-01-23 17:30

with this temporary fix in place, i'm going to start working on a
spam-assasin style userscript for /prog/. this seems to be a much
better approach than requiring hashtags.

Name: Anonymous 2011-01-23 17:32

>>5
if ( contents.innerHTML.match(/<.*?>/gi).length > 100 )
I'm not sure of what it does. It matches a single tag that is longer than 100 characters?

Name: Anonymous 2011-01-23 17:38

>>7

<.*?> matches a a single tag (including closing tags and shit like <br/>)
//g means match all (instead of first)
str.match(regexp) returns an array of tags

Name: Anonymous 2011-01-23 17:49

>>8
And what's the point of this?

Name: Anonymous 2011-01-23 17:55

>>10
mutes autism boy?

Name: Anonymous 2011-01-23 18:07

>>10
How does matching tags that will never be longer than 100 characters mute the autistic kids?

Name: Anonymous 2011-01-23 18:08

>>6
I'm sure there was something like that...
Ah, here it is. http://dis.4chan.org/read/prog/1244428965

Name: Anonymous 2011-01-23 19:14

>>11
STFU the code works >>8 explains why

>>12
there's also a pretty nice javascript bayes implementation here:
http://rephrase.net/days/07/08/javascript-bayes

these two could probably be combined somehow

Name: Anonymous 2011-01-23 19:19

>>13
STFU the code works >>8 explains why
Sorry, after thinking a little about it, it makes sense.

Don't change these.
Name: Email:
Entire Thread Thread List