Author Topic: Greasemonkey  (Read 118 times)

Bradley Young

  • club
  • Senior Member
  • *
  • Posts: 1486
Greasemonkey
« on: May 29, 2007, 07:38:22 PM »
All,
 
I've been experimenting with GreaseMonkey.  Greasemonkey is a Firefox extension that allows you to customize the way webpages look and function.
 
I needed an experiment, and thought I'd try to implement a killfile.  If you have greasemonkey, you can install this, configure users in the killFile variable (I have conveniently configured myself! ), and you will no longer see posts from said users.  You only need to configure each user once, I just have the second one so you can see how lists are formatted.
 
I'd love any feedback you might have (or, heaven forbid, any bugs).
 
Here it is:
 
// ==UserScript==
// @name           Alembic killfile
// @namespace      http://alembic.com/club/
// @description    Remove the posts of certain users.
// @include        http://alembic.com/club/*
var killFile =
[
 byoung,
 byoung
];
 
var matcher = new RegExp(killFile.map(convertToProfileURL).join“.toLowerCase());
 
var tableCells = document.evaluate(
               '/HTML[1]/BODY[1]/TABLE[1]/TBODY[1]/TR[1]/TD[1]/TABLE[1]/TBODY[1]/TR',  
               document,  
               null,  
               XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
               null);
 
if (!tableCells || killFile.length == 0) return;
 
for (var i = 0; i