Nobody gives a Fark

By MrEricSir Last update Jan 23, 2008 — Installed 511 times.
// ==UserScript==
// @name          Nobody gives a Fark
// @namespace     http://userscripts.org/users/2460
// @description   Removes ads on Fark.com for a nicer layout.  Also hides useless header thingie.
// @version       1.0.0
// @date          2008-01-22
// @include       http://*.fark.com/*
// @include       http://fark.com/*
// @include       http://foobies.com/*
// @include       http://*.foobies.com/*
// @include       http://*.blender.com/fark/*
// @include       http://blender.com/fark/*
// ==/UserScript==
//
// Removes Fark ads and header as of 2008.01.22
//


//
// Add global CSS styles
//
// from http://diveintogreasemonkey.org/patterns/add-css.html
//
function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}


// Kill the ads, other junk.  DO NOT WANT.
var headerTop = document.getElementById('headerTop');
var rightAd300x250 = document.getElementById('rightAd300x250');
var rightAd160x600 = document.getElementById('rightAd160x600');
var rightAd160x600two = document.getElementById('rightAd160x600two');
var rightSideRightMenubar = document.getElementById('rightSideRightMenubar');
var headerTable = document.getElementById('headerTable');
var W46f4189ce9fdcfd = document.getElementById('W46f4189ce9fdcfd');

if ( headerTop ) {
  headerTop.parentNode.removeChild( headerTop );
}
if ( rightAd300x250 ) {
  rightAd300x250.parentNode.removeChild( rightAd300x250 );
}
if ( rightAd160x600 ) {
  rightAd160x600.parentNode.removeChild( rightAd160x600 );
}
if ( rightAd160x600two ) {
  rightAd160x600two.parentNode.removeChild( rightAd160x600two );
}
if ( rightSideRightMenubar ) {
  rightSideRightMenubar.parentNode.removeChild( rightSideRightMenubar );
}
if ( headerTable ) {
  headerTable.parentNode.removeChild( headerTable );
}
if ( W46f4189ce9fdcfd ) {
  W46f4189ce9fdcfd.parentNode.removeChild( W46f4189ce9fdcfd );
}


// Make it all pretty.  Well... relatively.  I'm no graphic designer.
addGlobalStyle('#bodyRightSideContainer { width: 160px; }');
addGlobalStyle('#bodyHeadlineContainer { margin: 0 175px 15px 0; }');

// That's it!  Any suggestions, e-mail me kthnxbye.