Help Choggi, your script is killing me
  • ChoGGI,

    I don't remember where I got this but it has your name on it. I can't find it at userscripts.org. Recently it has started blocking entire pages at usertsyles.org - probably a change to usetstyles.org.

    [code]
    // ==UserScript==
    // @name userstyles hide websites
    // @namespace http://choggi.dyndns.org
    // @include http://forum.userstyles.org/*
    // @include http://userstyles.org/*
    // @include http://www.userstyles.org/*
    // ==/UserScript==

    //edit to suit your tastes (i = ignore case)
    var hideThese = [/facebook/i,/tumblr/i,/dashboard/i,/michael jackson/i,/orkut/i,/reddit/i,/linkedin/i,/jappy/i];

    //list all links in page
    var linkList = document.getElementsByTagName("a");
    //loop through the links
    for (var i = 0; i < linkList.length; i++){
    var link = linkList[i].firstChild.textContent;
    //then check with the user list
    for (var j = 0; j < hideThese.length; j++){
    if (link.match(hideThese[j]) != null){
    //hide it
    linkList[i].parentNode.style.display = "none";
    //linkList[i].parentNode.setAttribute("class","spamSite");
    if (linkList[i].parentNode.parentNode.parentNode.nodeName == "ARTICLE"){
    linkList[i].parentNode.parentNode.parentNode.style.display = "none";
    }
    }
    }
    }
    [/code]

    Umm, I apparently also don't know how to use the [code] tag.
  • Webb,
    i'm using this one and have no problems, try it:

    // ==UserScript==
    // @name Remove Junk Style Links (Forums)
    // @namespace http://choggi.dyndns.org
    // @include http://forum.userstyles.org/*
    // ==/UserScript==

    //edit to suit your tastes (i = ignore case)
    var hideThese = [/Facebook/i,/Tumblr/i,/facebook/i,/Appchan/i,/Reddit/i,/Gaia/i,/Google Reader/i,/4chan/];

    //list all links in page
    var linkList = document.getElementsByTagName("a");
    var spanList = document.getElementsByTagName("span");
    //loop through the links
    for (var i = 0; i < linkList.length; i++){
    var link = linkList[i].textContent;
    //then check with the user list
    for (var j = 0; j < hideThese.length; j++){
    if (link.match(hideThese[j]) != null){
    //hide it
    var parent = linkList[i].parentNode.parentNode.parentNode;
    if (parent.className.indexOf("Discussions") != -1){
    linkList[i].parentNode.parentNode.style.display = "none";
    }
    }
    }
    }
    //loop through the spans
    for (var i = 0; i < spanList.length; i++){
    var span = spanList[i].textContent;
    //then check with the user list
    for (var j = 0; j < hideThese.length; j++){
    if (span.match(hideThese[j]) != null){
    //hide it
    var parent = spanList[i].parentNode.parentNode.parentNode;
    if (parent.className.indexOf("Discussions") != -1){
    spanList[i].parentNode.parentNode.style.display = "none";
    }
    }
    }
    }


    To use code (or whatever) in this forum, don't forget, you can't use BBcode here, it has to be html (PITA to remember that every time, i must add!).
  • Thanks, works like a charm.
  • Awesome, you're welcome!
    I have no idea what this means though, i simply copied what he had there and added stuff in the same manner, i'm a dufus when it comes to js, a proven fact: (i = ignore case)
  • I spoke too soon. The new script doesn't work at all.

    I can see Facebook and Jappy styles.
  • I think I fixed it. I changed the URL selectors.

    / ==UserScript==
    // @name userstyles hide websites
    // @namespace http://choggi.dyndns.org
    // @include http://forum.userstyles.org/*
    // @include http://www.userstyles.org/styles/browse*
    // ==/UserScript==

    //edit to suit your tastes (i = ignore case)
    var hideThese = [/facebook/i,/tumblr/i,/dashboard/i,/michael jackson/i,/orkut/i,/reddit/i,/linkedin/i,/jappy/i];

    //list all links in page
    var linkList = document.getElementsByTagName("a");
    //loop through the links
    for (var i = 0; i < linkList.length; i++){
    var link = linkList[i].firstChild.textContent;
    //then check with the user list
    for (var j = 0; j < hideThese.length; j++){
    if (link.match(hideThese[j]) != null){
    //hide it
    linkList[i].parentNode.style.display = "none";
    //linkList[i].parentNode.setAttribute("class","spamSite");
    if (linkList[i].parentNode.parentNode.parentNode.nodeName == "ARTICLE"){
    linkList[i].parentNode.parentNode.parentNode.style.display = "none";
    }
    }
    }


  • Oh, i don't use it for styles, sorry. I use srazzano' table script (and so should you!): http://userscripts.org/scripts/show/100937

    The script above is for the forum, it hides threads with those styles, my apologies for the confusion Oi!
  • @Webb
    Or you can try my Forum Extract script at http://userscripts.org/scripts/source/111438.user.js
    If you do not like the custom theming of the page, in the script, delete all the css in between
    // CSS Forum ========== and // CSS Forum Extract ==========. It gives you the ability to add/delete keywords/phrases form the forum page header. If you use the script and want to make the search non-case sensitive, look for this in the script: var word = new RegExp('\\b' + names[x] + '\\b', 'g'); and change the 'g' to 'i' and change var fe4 = 'Case-Sensitive Filter'; to var fe4 = 'what ever text you want to display'. You can manually type keywords into the inputbox or place the mouse just above the link, without selecting the link, at the beginning of the phrase, hold mouse button down and drag to the end of the phrase and release the button and it will be inserted into the inputbox. Place your mouse just above the link word, without selecting the link, and double clicking will insert that word into the inputbox. Double clicking in the inputbox clears the field and middle click in the inputbox inserts all the keywords you have stored. It will aslo only search for whole words and not part of a word. Example: "book" will not catch "facebook". Clicking on filtered button when a post is hidden, will change the button text to unfiltered and display the post with a red X before the title.
  • I couldn't get either of those scripts to work properly with Fx 3.6 but the modified version of choggi's script works fine.
  • Wow! Fx3.6 Yeah, script is coded for 10.* and up, possibly 4.0 and up.
  • I have Pale Moon 4 but I don't even have it tweaked yet and they're up to version 9. Pale Moon is skipping version 10.

    Firefox/Pale Moon aren't worth updating unless something serious breaks.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!