ss_blog_claim=4079d6def1eb3506940afc491a88a95f

Eliminate extra exclamation points!!!

Scripts Add comments

I’m not militant about punctuation but i do find it annoying when people write things with lots of exclamation points. So i created a Greasemonkey script that turns anything more than two exclamation points into just one. Greasemonkey has to be installed and you need to be using Firefox in order for this to work. If you have them both already then grab my excessive exclamation points script. There is some excessive punctuation below for you to test. After you have installed the script just refresh this page and you should see the exclamation points disappear from this post’s title and the lines below.

Two exclamation points!!
Ten exclamation points!!!!!!!!!!
Five exclamation points and a number one!!!!!1
Forty Two!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

I’ve also uploaded the script to userscripts.org here.

(Thank you for all the code suggestion and corrections!)



Related Posts

23 Responses to “Eliminate extra exclamation points!!!”

  1. Larixk Larixk Says:

    Nice script,
    but why not use RegExp the way they’re meant.
    If you use “!+” as a pattern it will replace strings of !’s of any length >0. Even greater than 42. :)

  2. Sam Sam Says:

    I love this script!!!!!!!!!!!!!!!! And it works as well.

  3. zieak zieak Says:

    Larixk - Thanks for the tip. I’m definitely not a coder.

  4. Rob Rob Says:

    Regarding this line: for (var i = 0; i

  5. Rob Rob Says:

    Ergh, it ate my post. :(

    Regarding this line: for (var i = 0; i %lt; textnodes.snapshotLength; i++)

    I’d be a liar if I said I knew what snapshotLength does. I can’t help but think, though, that assigning textnodes.snapshotLength to a variable before hitting the loop would be faster than having to compute textnodes.snapshotLength every time. Especially on pages with lots of text nodes.

  6. Pieter De Decker Pieter De Decker Says:

    Great script!

    Multiple exclamation points annoy me very much and it’s good to see that somebody came up with a solution for this.

  7. perfect failure dot org » !! = ! perfect failure dot org » !! = ! Says:

    […] Eliminate extra exclamation points!!! on Zieak’s Blog […]

  8. Ron Ron Says:

    Nice–thanks!!!

  9. Divergentdave Divergentdave Says:

    // ==UserScript==
    // @name Eliminate excessive exclamation points
    // @namespace http://www.zieak.com
    // @description Turns exclamation points into just one
    // @include *
    // ==/UserScript==

    (function() {
    var regex, textnodes, node, length;
    textnodes = document.evaluate( “//body//text()”, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    length = textnodes.snapshotLength;
    regex = new RegExp(’![!1]+’, ‘g’);
    for (var i = 0; i

  10. Mattie’s Blog » Blog Archive » I’m not the biggest fan of exclamation points. Mattie’s Blog » Blog Archive » I’m not the biggest fan of exclamation points. Says:

    […] Over on digg, I saw a very Mattie-like script for GreaseMonkey/Firefox– it’s used to eliminate extra exclamation points on webpages. Using this, now I never have to look at web sites with painful exclamations. This is a comforting thought. […]

  11. fearphage fearphage Says:

    Are you serious?

    (function(){
    for (var nodes = document.selectNodes(’//body//text()[contains(.,”!!”)]’), i = 0, node; node = nodes[i]; i++)
    node.data = node.data.replace(/!!+/g, ‘!’);
    })()

    Not sure if Firefox supports selectNodes

  12. Billy Billy Says:

    This blog post was linked on Lifehacker, and there were alot of comments there “challenging” what it couldn’t do. I took a few minutes to add a few patterns to deal with those cases as well.

    Here, enjoy some more regexes (drop these into the script in place of the existing portion)

    This should cover ??????, !?!?!?!?!, and !!!11!!!!!11!!1!1

    http://www.doorknobsoft.com/codetests/exclam_regex.txt

  13. clawbakes clawbakes Says:

    thanks. my hero.

  14. zieak zieak Says:

    Thanks Billy - i wanted to include a way to fix those also but making those changes doesn’t seem to work for me.

  15. random assignment » Useful tool for students (and others) random assignment » Useful tool for students (and others) Says:

    […] Today’s download is a Greasemonkey script for Firefox that removes excessive exclamation points from websites. One thing I hate about the Internet even more than msypace is when is LOL!!!!!!!! somewhere. This script, once installed, removes the annoyingly high number of exclamation points, leaving you with just one (so LOL!!!!!!!! become LOL!, which is marginally less annoying). […]

  16. Ivar Zantinge » Blog Archive » Eliminate exclamation points!!!!! Ivar Zantinge » Blog Archive » Eliminate exclamation points!!!!! Says:

    […] OMG!!!! If you’re just as sick as I am of seeing excessive exclamation points on the web (!!!), automatically eliminate ‘m with the Excessive Exclamation Point Greasemonkey script!!! This only works in Firefox!!! […]

  17. urbanbohemian.com » oh em gee, SNOW! urbanbohemian.com » oh em gee, SNOW! Says:

    […] And just for fun, a nifty little Greasemonkey script for getting rid of the extra exclamation points seen on LJ, myspace, and anywhere else people don’t get that it just takes one to express excitement (and for those that mock them as well). […]

  18. Joe Philipson Joe Philipson Says:

    Wow, great app. I’m going to link you to my blog.
    -Joe

  19. Inside Joe’s Head » Eliminate extra exclamation points!!! on Zieak’s Blog Inside Joe’s Head » Eliminate extra exclamation points!!! on Zieak’s Blog Says:

    […] Eliminate extra exclamation points!!! on Zieak’s Blog […]

  20. The Burncopy » links for 2007-01-20 The Burncopy » links for 2007-01-20 Says:

    […] Eliminate extra exclamation points!!! on Zieak’s Blog Greasemonkey script to eliminate extra exclamation points!!!!!!!!!!!!!!!!!!!! Categories: The Copyright Convention […]

  21. Monoto Monoto Says:

    My coding knowledge is virtually nil, or I’d take a stab at this myself, so here’s a suggestion.

    Is there any way to make the replacement exclamation mark colored? Maybe a dark red so it’s noticeable without being blatant?

  22. zieak zieak Says:

    Good idea - I’ll take a stab at it sometime and if i get it working i’ll email you and let you know.

  23. Bernard Yaple Bernard Yaple Says:

    This one makes sence “One’s first step in wisdom is to kuesstion everything - and one’s last is to come to terms with everything.”

Leave a Reply

Entries RSS Comments RSS Log in