d2jsp
Log InRegister
d2jsp Forums > Off-Topic > General Chat > General Archive > ___blah2k6's D2jsp Post Blocker___ > Greasemonkey Script For D2jsp Forums
Prev15678949Next
Add Reply New Topic
Member
Posts: 14,730
Joined: Aug 20 2009
Gold: 29.81
Aug 11 2011 08:44pm
iso google chrome herp
Member
Posts: 22,247
Joined: Oct 11 2007
Gold: 1,001.25
Trader: Trusted
Aug 11 2011 09:16pm
Thanks you kind sire.
Member
Posts: 12,712
Joined: Oct 4 2006
Gold: 34.08
Aug 11 2011 09:44pm
Posting in a carebear thread.
Member
Posts: 57,889
Joined: May 23 2007
Gold: 0.00
Aug 11 2011 09:49pm
good now i can block ogredan
Member
Posts: 89,516
Joined: Sep 23 2006
Gold: 174,045.01
Aug 11 2011 09:51pm
To all chrome users

there is a simple way how you can use my script.
you need to install a chrome extension called TamperMonkey, you can get it here: https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
afterwards you can just go to my userscript link ( http://userscripts.org/scripts/show/109933 ) and install the script. (you have to press the install button on the left side or in the middle.
right now i can't tell you where chrome/tampermonkey stores the value for the color, but i can try to find it out.
i will keep you updated, atleast you can use it now with chrome
Member
Posts: 53,900
Joined: May 9 2005
Gold: Locked
Warn: 40%
Aug 12 2011 08:11am
gut :)
Member
Posts: 32,004
Joined: Jun 24 2010
Gold: 81.17
Aug 12 2011 08:15am
:blink:

I don't want to block anyone :(
Member
Posts: 21,024
Joined: Nov 21 2010
Gold: 4,161.00
Warn: 30%
Aug 12 2011 08:15am
Quote (blah2k6 @ 12 Aug 2011 03:51)
To all chrome users

there is a simple way how you can use my script.
you need to install a chrome extension called TamperMonkey, you can get it here: https://chrome.google.com/webstore/detail/dhdgffkkebhmkfjojejmpbldmpobfkfo
afterwards you can just go to my userscript link ( http://userscripts.org/scripts/show/109933 ) and install the script. (you have to press the install button on the left side or in the middle.
right now i can't tell you where chrome/tampermonkey stores the value for the color, but i can try to find it out.
i will keep you updated, atleast you can use it now with chrome


thx :bouncy:
Member
Posts: 11,683
Joined: Dec 30 2006
Gold: 0.00
Aug 12 2011 08:36am
This is awesome, thanks! If only it could remove peoples threads who you've blocked as well... :)

Tyvm for this excellent add-on!

*Psss, Get it working for Safari ^^
Member
Posts: 61,418
Joined: Nov 21 2006
Gold: Locked
Aug 12 2011 08:57am
Quote (HighschoolTurd @ 11 Aug 2011 21:28)
Code
// ==UserScript==
// @name          blah2k6's d2jsp post blocker
// @description   Hides posts from a defined list of users
// @namespace   d2jsp.postblocker
// @include       http://forums.d2jsp.org/topic.php?t=*&f=*
// ==/UserScript==

function addToBlockList(username)
{
var strList = GM_getValue("blocklist", "");
if(strList == "") GM_setValue("blocklist", username + ";");
else
{
 if(strList.indexOf(username) == -1)
 {  
  GM_setValue("blocklist", strList + username + ";");
  window.location.reload();
 }
}
}

function removeFromBlockList(username)
{
var strList = GM_getValue("blocklist", "");
if(strList.indexOf(username) != -1)
{
 strList = strList.replace(username + ";", "");
 GM_setValue("blocklist", strList);
 window.location.reload();
}
}

function isInBlockList(username)
{
var strList = GM_getValue("blocklist", "");
if(strList.indexOf(username) != -1) return true;
else return false;
}

function getElementsByClassName(classname, par){
  var a=[];
  var re = new RegExp('\\b' + classname + '\\b');
  var els = par.getElementsByTagName("*");
  for(var i=0,j=els.length; i<j; i++){
     if(re.test(els[i].className)){
        a.push(els[i]);
     }
  }
  return a;
}

function showPost(div, username, postID, fr, ftb, frContent, ftbContent)
{
if(frContent.indexOf("Hide Post") == -1) fr.innerHTML = '<a href="javascript:void(0)" id="h' + postID + '">Hide Post</a>' + frContent;
else fr.innerHTML = frContent;
ftb.innerHTML = ftbContent;
document.getElementById('h' + postID).addEventListener('click', function(){ createHTML(div, username, postID, fr, ftb) }, true);
}

function createHTML(div, username, postID, fr, ftb)
{
var br = document.createElement('BR');
var holder = document.createElement('B');
var frSave = fr.innerHTML;
var ftbSave = ftb.innerHTML;

if(isInBlockList(username))
{
 
 fr.innerHTML = '<a href="javascript:void(0)" id="s' + postID + '">Show Post</a><a href="javascript:scroll(0,0)">Top</a>';
 ftb.innerHTML = '<div class="foot ce ta"><b>Post by this user are blocked. <a href="javascript:void(0)" id="ub' + postID + '">Unblock</a></div>';
}
else
{
 var colorBL = GM_getValue("blockLinkColor", "red");
 holder.innerHTML += '<a href="javascript:void(0)" id="b' + postID + '"><font color="' + colorBL + '">Block Posts</font></a>';
 var beforeEle = div.getElementsByTagName('DIV')[0];
 div.insertBefore(holder,beforeEle);
 div.insertBefore(br,beforeEle);
}
if(document.getElementById('b' + postID) != null) document.getElementById('b' + postID).addEventListener('click', function(){ addToBlockList(username) }, true);
else
{
 document.getElementById('ub' + postID).addEventListener('click', function(){ removeFromBlockList(username) }, true);
 document.getElementById('s' + postID).addEventListener('click', function(){ showPost(div, username, postID, fr, ftb, frSave, ftbSave) }, true);
}
}

function loadPage()
{
       if(GM_getValue("blockLinkColor", "") == "")
{
 GM_setValue("blockLinkColor", "red");  
}
var dl = document.getElementsByTagName('DL');
var fr = getElementsByClassName('fR', document);
var bc1 = getElementsByClassName('bc1',document);
var dt = document.getElementsByTagName('DT');
var ftb = getElementsByClassName('ftb', document);
var name,postID,strDT,strName,strPostID,dlOffset,dtOffset,bc1Offset,frOffset, ftbOffset;
dlOffset = 0;
dtOffset = 0;
bc1Offset = 0;
frOffset = 1;
ftbOffset = 0;

for(var i=0;i<dl.length;i++)
{
 if(dt[i + dtOffset].innerHTML == 'User Poll')
 {
  dtOffset++;
  dlOffset++;
  ftbOffset++;
 
 }
 

 strDT = dt[i + dtOffset].firstChild;
 postID = strDT.name;

 if(strDT.innerHTML.indexOf('<') == 0)
 {
  strDT = strDT.firstChild;
 }

 
 strName = strDT.innerHTML;
 
 var idx = strName.indexOf('<');
 if(idx != -1)
 {
  name = strName.substring(0,idx)
 }
 else
 {
  name = strName;
 }
 
 name = name.replace(/ /gi,'');
 
 createHTML(bc1[i + bc1Offset],name,postID, fr[i + frOffset], ftb[i + ftbOffset]);

}

}

loadPage();




ANYONE WANNA TELL ME WERE U SEE A KEY LOGGER IN THERE? NOOBS LOOOOOOOOL


How many people already have highschoolturd on their block list?
Go Back To General Archive Topic List
Prev15678949Next
Add Reply New Topic