Remove NewsDesk from IMDb.com

Subscribe to Remove NewsDesk from IMDb.com 3 posts, 2 voices

 
Webb User

Imdb.com has added more useless content. I have been removing selected .info items using a modified version of http://userscripts.org/scripts/show/9702 but it won't remove the NewsDesk. The code that doesn't work is


// Imdb.com News Removal Script
// version 1.0
// 2007-06-07
//
// ==UserScript==
// @name Imdb.com News Removal Script
// @description Remove the news section from Imdb.com pages.
// @include http://imdb.com/title/*
// @include http://*.imdb.com/title/*
// ==/UserScript==

// Fill an array with all div objects
var arrDiv = document.getElementsByTagName('div');

// Iterate through div objects
for( var i=0; i<arrdiv>
{
// Only test div objects which contain exactly one

tag
if( arrDiv[ i ].getElementsByTagName('h5').length == 1 )
{
// Test for the appropriate string
if( arrDiv[ i ].getElementsByTagName('h5')[0].textContent == "NewsDesk:" )
{
// Remove desired object, then exit
arrDiv[ i ].parentNode.removeChild( arrDiv[ i ] );
return;
}
}
}

Can someone fix this for me?

 
Mikado Scriptwright

I never understood people who care about writing licence blocks and copyrights in their scripts instead of writing better code.

var nd = document.evaluate('//h5[./text()[1]="NewsDesk:"]', document, null, 8, null).singleNodeValue;
if (nd) nd.parentNode.parentNode.removeChild(nd.parentNode);

 
Webb User

2 thumbs up Mikado. Thanks!