GreaseMonkey: Helping To Make ColdFusion Developer's Journal NOT Suck

Posted March 14, 2007 at 1:59 PM by Ben Nadel

Tags: ColdFusion, Javascript / DHTML

I have to say that the ColdFusion Developer's Journal is one of those resources that I never use for the simple fact that interfacing with it is a horrible, horrible, horrible experience. I am on a T1 line here at work and CFDJ take about 14 seconds to load every page. Then, there's that Flash advert that always auto plays.

MAKES ME WANT TO KILL PEOPLE AND EAT THEIR BRAINS!

The problem is, CFDJ has great content - I just can't use it. Well, not any more! I finally sat down and wrote a GreaseMonkey script (FireFox, I love you) that rips all the annoying crap out of the page once it loads. This won't make the page load faster (as GreaseMonkey doesn't kick in until after the DOM is fully loaded), but at least it won't make me want to kill people any more (you are all finally safe!).

Who knows, I might even start to read CFDJ :)

If any one is interested, here is the GreaseMonkey script (click to install):

cfdj_clean.user.js

  • // ==UserScript==
  • // @name CFDJ - Cleaner
  • // @namespace http://www.bennadel.com/
  • // @description This cleans up the CFDJ page so that it
  • // does not drive me crazy and make me want
  • // to go around killing people.
  • // @include http://coldfusion.sys-con.com/*
  • // ==/UserScript==
  •  
  •  
  • // Get page elements.
  • var objHeader = document.getElementById( "pageheader" );
  • var objPanel1 = document.getElementById( "#panel1" );
  • var objPanel6 = document.getElementById( "#panel6" );
  • var objMainPanel = document.getElementById( "#mainpanel" );
  •  
  • // Try to manipulate the DOM.
  • try {
  •  
  • // Check to see if the header was found.
  • if (objHeader){
  •  
  • // Grab the tables from the header, but then get a
  • // to the first one. This is the main navigation
  • // table. We don't want to kill it.
  • var objHeaderTable = objHeader.getElementsByTagName( "table" )[ 0 ];
  •  
  • // Get the parent to this table.
  • var objParent = objHeaderTable.parentNode;
  •  
  •  
  • // Loop over the parent children in reverse order (so we
  • // don't go out of bounds).
  • for (
  • var intChild = (objParent.childNodes.length - 1) ;
  • intChild >= 0 ;
  • intChild--
  • ){
  •  
  • // Get a pointer to the current node.
  • var objNode = objParent.childNodes[ intChild ];
  •  
  • // Check to make sure the current node is NOT our
  • // main navigational table. Remember, we don't want
  • // to kill that one.
  • if (objNode != objHeaderTable){
  •  
  • // Remove this child.
  • objParent.removeChild(
  • objNode
  • );
  •  
  • }
  • }
  •  
  • }
  •  
  •  
  • // Check for elemnts and remove them.
  • if (objPanel1){
  • objPanel1.parentNode.removeChild( objPanel1 );
  • }
  •  
  • if (objPanel6){
  • objPanel6.parentNode.removeChild( objPanel6 );
  • }
  •  
  •  
  • // Now that we have more room, let's increase the width
  • // of the main content area.
  • if (objMainPanel){
  • objMainPanel.style.width = "700px";
  • }
  •  
  •  
  • } catch (objError){
  •  
  • // Something went wrong.
  • alert( "Greasemonkey Error:\n\n" + objError );
  •  
  • }


Reader Comments

Mar 14, 2007 at 2:54 PM // reply »
23 Comments

Nice script, and yes i agree, cfdj's interface really bites.

What upsets me, is that they are considering also to not print anymore, and go strictly to pdf's.

I am an old-schooler, i love having dozen's of cfdj's to peruse, look back at, in my hands.

Sometimes change is good, but sometimes it isn't.


Mar 14, 2007 at 2:59 PM // reply »
10,638 Comments

I agree... printing is nice. I guess, you can always print from PDF (which is cool to do at work when no one is looking ;)).... but something nice about being able to flip through a real mag on the subway or in the bathroom or something.


Mar 14, 2007 at 4:04 PM // reply »
4 Comments

Getting rid of those unwanted videos can be much easier using Adblock Plus that I use in place of Greasemonkey.


Mar 14, 2007 at 4:08 PM // reply »
10,638 Comments

What is AdBlock Plus? Is that a FireFox extension?


Mar 14, 2007 at 4:11 PM // reply »
4 Comments

Yep Ben,

Oh seems you havent heard of it.. Install it & believe me you will love it without any scripting you can control most of the unwanted stuff from a page.

I am using Adblock to even disable google ads(present in 90% of pages we visit)


Mar 14, 2007 at 4:44 PM // reply »
6 Comments

Make sure you install "Adblock Filterset.G Updater" with Adblock. This will keep your filter list current.


Mar 14, 2007 at 5:03 PM // reply »
10,638 Comments

Cool, thanks guys. I will check it out.


Mar 14, 2007 at 7:19 PM // reply »
6 Comments

This is awesome! No more Microsoft ads of noisy newspaper factories blasting over my speakers.

Thanks!


Mar 14, 2007 at 11:13 PM // reply »
1 Comments

Then there's Aardvark -- you activate it, then you can focus on just the center box, and one key (I think it's "I") to isolate that box. Really cool stuff.


Mar 15, 2007 at 1:15 AM // reply »
46 Comments

Are you aware of this:
http://cfdj.sys-con.com/index.rss

Some sites have the whole articles this way, but CFDJ just has the headlines. You could write a CF app that reads them all (And other sites you like) and collate all the results into a collected CF Resource site.

They also have free RSS Readers that you could view this in. example: http://www.feedreader.com/screenshots.php

I think you should make a Mashup site that pulls content from lots of CF feeds and strips out the garbage.

Glen


Mar 15, 2007 at 9:14 AM // reply »
9 Comments

then there's Platypus
http://platypus.mozdev.org/
a nice little extension that along with Greasemonkey can make your life easier and everything in a couple of clicks.

It's basically a graphical way of creating GM scripts for specific websites.

I live near DC so having to read washingtonpost online was a miserable experience, ads everywhere and the content always broken in multiple sections.

After Platypus I get rid of all the fat and just concentrate in the meat of the articles.

Try it, you'll see.


Mar 15, 2007 at 9:44 AM // reply »
10,638 Comments

Awesome. I will check it out. FireFox is so awesome.


Mar 16, 2007 at 7:47 AM // reply »
10,638 Comments

I just installed AdBlock Plus. Works awesome! Not only that, my pages are loading much faster. Thanks.


May 3, 2007 at 7:30 AM // reply »
4 Comments

LMFAO.. Superb article and inspiring GM script - top job.

Reading this article really does fill me with joy as I have been getting more and more angry with sys-con.com. The website is a total joke - packed full of commercial crap and adverts, adverts, adverts..
That's why it's strange how good CFDJ is.

I was getting incredibly angry with sys-con over that past month or so as we paid for a 2 year subscription, saw it was billed on the company credit card, but our account status was stuck on 'Pending Approval'! I must have submitted about 6 support mails which claims a 12 hour response but to this date have received *nothing*. Absolutely pathetic customer service.. I'm amazed they stay in business...

All said and done though, CFDJ is a superb resource and well worth paying for.. Just a shame sys-con.com isn't on the same level...

Will install the script now.. brilliant work.


May 3, 2007 at 7:58 PM // reply »
10,638 Comments

Glad you like it (and my writing ;)).



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Feb 3, 2012 at 10:49 PM
How I Got Node.js Running On A Linux Micro Instance Using Amazon EC2
Wow this was really helpful! Only thing I would add is you need to update your .bash_profile after you edit the secure_path. This is what I did: $ . ~/.bash_profile Otherwise, NPM won't be found. ... read »
Feb 3, 2012 at 10:14 PM
Pushing Base64-Encoded Images Over HTML5 WebSockets With Pusher And ColdFusion
@Ben, Just wanted to let you know that pusher are soon to start limiting sizes on messages. This was the detail that came through in the Feb dispatch: "However, we will soon be limiting the s ... read »
Feb 3, 2012 at 5:05 PM
Regular Expressions Make CSV Parsing In ColdFusion So Much Easier (And Faster)
I tried using your RegEx in my C# program, but it was matching an extra empty-string at the end and so I would end up with an extra field that doesn't exist, so I changed it to this: (^|,)("(?: ... read »
Feb 3, 2012 at 3:47 PM
ColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)
Josh Cyr posted this on Twitter just a little bit ago. Thought it was appropriate. http://stackoverflow.com/questions/1619152/how-to-create-rest-urls-without-verbs/1619677#1619677 ... read »
Feb 3, 2012 at 2:28 PM
Changing The Execution Context Of Your Self-Executing Function Blocks In JavaScript
@Michael, You definitely make a good point (and extra points for quoting movies - I love movies). When you use a return() statement to define the object's public API, it does provide a consistent a ... read »
Feb 3, 2012 at 2:04 PM
Changing The Execution Context Of Your Self-Executing Function Blocks In JavaScript
To quote Jurassic Park: "Just because you can doesn't mean you should". I completely, utterly disagree with the thought that this is more readable. Consider the current module pattern: if ... read »
Feb 3, 2012 at 1:10 PM
REST API Design Rulebook By Mark Masse
@Jordan, Yeah, WRML was created by Mark Masse (author of the book). I also found it to be a bit convoluted. I suppose it is intended to allow the Client to be able to programmaticaly respond to cha ... read »
Feb 3, 2012 at 1:08 PM
ColdFusion Supports HTTP Verbs PUT And DELETE (As Well As GET And POST)
@Jason, To be honest, I don't have good answers for that kinds of stuff. And, to the point, that is specifically why I *really* liked the REST API Design Rulebook by Mark Masse - he just cuts throu ... read »