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

Pages: 1-

necro weed posting considered harmful

Name: Anonymous 2010-06-02 13:12

on the other hand /prog/ actually was good once

Name: Anonymous 2010-06-02 13:27

This is what greasemonkey is for Don't see their posts!

Name: Anonymous 2010-06-02 13:29

Dear 2012 self,

Be reminded that /prog/ was never good.
Also, I'm really sorry about the election results.

Name: Anonymous 2010-06-02 14:48

Hey /prog/, I tried whipping up a quick greasemonkey script to hide the necrothreads, but I can't see why this doesn't remove all threads not created this year. Any chance you can tell me where I've went wrong?
var dateregex = /^2010/;
var threads = document.getElementsByClassName('thread');
for (i=0; i<threads.length; i++) {
  var thread = threads[i];
  var opdate =  thread.getElementsByClassName('posterdate')[0].firstChild.nodeValue;
  if (!dateregex.test(opdate)) {
    var parent = thread.parentNode;
    var grandparent = parent.parentNode;
    grandparent.removeChild(parent);
  }
}

Name: Anonymous 2010-06-02 14:54

>>4
stop tryig to reinvent the wheel

Name: Anonymous 2010-06-02 16:07

>>5
Yeah, thanks bro. I am well aware that we have an anti-necrobump script already, I do remember last year. I was writing the script for a reason, in this instance to try and reacquaint myself with Javascript and the DOM. But assuming that I hadn't heard of it, and was new here, it's not like we've advertised the anti-necro script much this year, as there has been less need for it. How would a newbie know?

For those that care, the problem was retardedly simple. I forgot that when the child was removed from the DOM, it was also removed from the threads array. And therefore, the call to threads.length was different every time. The solution is below
var dateregex = /^2010/;
var threads = document.getElementsByClassName('thread');
var len = threads.length
for (i=0; i < len;) {
  var thread = threads[i];
  var opdate =  thread.getElementsByClassName('posterdate')[0].firstChild.nodeValue;
  if (!dateregex.test(opdate)) {
    var parent = thread.parentNode;
    var grandparent = parent.parentNode;
    grandparent.removeChild(parent);
  } else {
  i++;
  }
}

Name: Anonymous 2010-06-02 16:18

>>6
If you don't also decrement len you'll run out of bounds.

How unfortunate is that Javascript's for-each operator is so retarded.

Name: air max shoes 2010-07-23 11:00

http://www.cheapairmaxs.com air max
http://www.cheapairmaxs.com air max shoes
http://www.cheapairmaxs.com/nike-air-max-2012-c-111.html nike air max 2012
http://www.cheapairmaxs.com/mens-air-max-2010-c-93.html mens nike air max 2010
http://www.cheapairmaxs.com/womens-air-max-2010-c-96.html womens nike air max 2010
http://www.cheapairmaxs.com/mens-air-max-2009-c-95.html mens nike air max 2009
http://www.cheapairmaxs.com/womens-air-max-2009-c-98.html womens nike air max 2009
http://www.cheapairmaxs.com/nike-air-max-2003-c-101.html nike air max 2003
http://www.cheapairmaxs.com/nike-air-max-97-c-94.html nike air max 97
http://www.cheapairmaxs.com/mens-air-max-95-c-102.html mens nike air max 95
http://www.cheapairmaxs.com/womens-air-max-95-c-103.html womens nike air max 95
http://www.cheapairmaxs.com/nike-air-max-93-c-106.html nike air max 93
http://www.cheapairmaxs.com/mens-air-max-91-c-104.html mens nike air max 91
http://www.cheapairmaxs.com/womens-air-max-91-c-105.html womens nike air max 91
http://www.cheapairmaxs.com/nike-air-max-89-c-121.html nike air max 89
http://www.cheapairmaxs.com/nike-air-max-88-c-112.html nike air max 88
http://www.cheapairmaxs.com/mens-air-max-87-c-108.html mens nike air max 87
http://www.cheapairmaxs.com/womens-air-max-87-c-109.html womens nike air max 87
http://www.cheapairmaxs.com/nike-air-max-180-c-123.html nike air max 180
http://www.cheapairmaxs.com/nike-air-max-360-c-124.html nike air max 360
http://www.cheapairmaxs.com/mens-air-max-ltd-c-122.html mens air max ltd
http://www.cheapairmaxs.com/womens-air-max-ltd-c-116.html womens air max ltd
http://www.cheapairmaxs.com/nike-air-max-bw-c-117.html nike air max bw
http://www.cheapairmaxs.com/air-max-premium-c-118.html air max premium
http://www.cheapairmaxs.com/air-max-skyline-c-114.html air max skyline
http://www.cheapairmaxs.com/air-max-zenyth-c-125.html air max zenyth
http://www.cheapairmaxs.com/nike-air-max-tn-c-115.html nike air max tn
http://www.cheapairmaxs.com/kids-air-max-90-c-119.html kids air max 90
http://www.cheapairmaxs.com/kids-air-max-bw-c-120.html kids air max bw

Name: Anonymous 2011-02-03 6:25

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