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
- My first .edu incoming link
- Strange Google traffic
- Doing surveys for free stuff
- Diamond Resorts is scamming me out of my points
- Get paid to host images with someone else?
Cena on
Tiffany on
Nicola on
cece on
zieak on
Karna on
January 19th, 2007 at 7:55 am
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.
January 19th, 2007 at 8:00 am
I love this script!!!!!!!!!!!!!!!! And it works as well.
January 19th, 2007 at 8:10 am
Larixk - Thanks for the tip. I’m definitely not a coder.
January 19th, 2007 at 9:18 am
Regarding this line: for (var i = 0; i
January 19th, 2007 at 9:18 am
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.
January 19th, 2007 at 9:33 am
Great script!
Multiple exclamation points annoy me very much and it’s good to see that somebody came up with a solution for this.
January 19th, 2007 at 10:30 am
[…] Eliminate extra exclamation points!!! on Zieak’s Blog […]
January 19th, 2007 at 12:31 pm
Nice–thanks!!!
January 19th, 2007 at 6:17 pm
// ==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
January 19th, 2007 at 7:17 pm
[…] 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. […]
January 19th, 2007 at 8:45 pm
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
January 19th, 2007 at 9:48 pm
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
January 19th, 2007 at 11:29 pm
thanks. my hero.
January 20th, 2007 at 12:55 pm
Thanks Billy - i wanted to include a way to fix those also but making those changes doesn’t seem to work for me.
January 21st, 2007 at 6:22 am
[…] 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). […]
January 22nd, 2007 at 12:28 am
[…] 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!!! […]
January 22nd, 2007 at 6:28 am
[…] 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). […]
January 25th, 2007 at 12:44 pm
Wow, great app. I’m going to link you to my blog.
-Joe
January 25th, 2007 at 12:46 pm
[…] Eliminate extra exclamation points!!! on Zieak’s Blog […]
February 4th, 2007 at 12:30 pm
[…] Eliminate extra exclamation points!!! on Zieak’s Blog Greasemonkey script to eliminate extra exclamation points!!!!!!!!!!!!!!!!!!!! Categories: The Copyright Convention […]
February 14th, 2007 at 9:11 am
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?
February 14th, 2007 at 9:55 am
Good idea - I’ll take a stab at it sometime and if i get it working i’ll email you and let you know.
June 14th, 2007 at 1:25 am
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.”