1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// 1. install greasemonkey @ https://addons.mozilla.org/en-US/firefox/addon/748
// 2. restart firefox
// 3. save this script to a file on your hard drive.. say workshack.user.js (click "download" to the right -->)
// 4. load this file in the browser by dragging it into a window.. when prompted, install
// 5. enjoy your shack
//
// ==UserScript==
// @name          WorkShack
// @namespace     http://gegtik.com/
// @description   Change all www.shacknews.com links to websense.shacknews.com
// @include       http://*.shacknews.com/*, http://*.lmnopc.com/*, http://*.thomwetzel.com/*
// ==/UserScript==

if( window.location.href.match(/www\.shacknews/i) )
	window.location.href = window.location.href.replace(/www\.shacknews/i, "websense.shacknews");

var allLinks, thisLink;
allLinks = document.evaluate(
    '//a[@href]',
    document,
    null,
    XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
    null);

for (var i = 0; i < allLinks.snapshotLength; i++) {
    thisLink = allLinks.snapshotItem(i);
    thisLink.href = thisLink.href.replace(/www\.shacknews/i, "websense.shacknews");
    if( thisLink.href.match(/&page=1/i) && thisLink.href.match(/websense\.shacknews\.com/i)  )
    {
    	thisLink.href = thisLink.href.substring(0,thisLink.href.indexOf("&"));
    }
}