Shorthand Notation For Searching BenNadel.com

Posted February 2, 2007 at 12:22 PM by Ben Nadel

I implemented this last week and have already grown to love it. It probably won't be useful to others but I thought I would throw it up here in case someone likes it. You can search my site by going to:

http://www.bennadel.com/search/YOUR_SEARCH_CRITERIA_HERE

... where everything after the "search/" will be the search criteria. This is great for me because I know what I have posted so I can be like "Oh yeah, where was that" and then search for it fast. It's not perfect, and if you search for "//" it gets the relative web paths messed up... but come on, it's just a short hand.



Reader Comments

Feb 2, 2007 at 12:57 PM // reply »
95 Comments

Nice, what did you use to do it?


Feb 2, 2007 at 1:55 PM // reply »
11,307 Comments

A lot of my site runs off of 404 error handling:

http://www.bennadel.com/index.cfm?dax=blog:286.view

I simply added one more piece of logic for the search section.


Feb 2, 2007 at 2:07 PM // reply »
95 Comments

I forgot about that thing, he he. Did you check out the free rewrite module for IIS? Here is my quick post about using it: http://boyank.blogspot.com/2007/01/rewriting-urls-in-iis-with-ionics-isapi.html


Apr 13, 2007 at 8:48 AM // reply »
95 Comments

I was searching your blog for something this morning so here is a quick bookmarklet I put together based on your search:

javascript:(function(){var url='http://www.bennadel.com/search/';searchString=prompt('Enter search string for BenNadel.com:','');searchString=((searchString==null)?'':searchString.replace(/^(\s+)?(.*?)(\s+)?$/gi,'$2'));if(searchString!=''){if(location.href.indexOf(url)==-1){var win=window.open(url+escape(searchString));}else{location.href=url+params+escape(searchString);}}})();


Apr 13, 2007 at 8:52 AM // reply »
11,307 Comments

Ha ha, Boyan, that's awesome. I just tried it and it works like a charm :)


Apr 13, 2007 at 8:58 AM // reply »
95 Comments

Ops,

I had a JavaScript error in the above script. Here is the updated one:
javascript:(function(){var url='http://www.bennadel.com/search/';searchString=prompt('Enter search string for BenNadel.com:','');searchString=((searchString==null)?'':searchString.replace(/^(\s+)?(.*?)(\s+)?$/gi,'$2'));if(searchString!=''){if(location.href.indexOf(url)==-1){var win=window.open(url+escape(searchString));}else{location.href=url+escape(searchString);}}})();


Apr 13, 2007 at 9:00 AM // reply »
11,307 Comments

Hmmm, it worked for me, but I wasn't trying to break it or anything (I did just one word). Looks good.


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
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Jun 17, 2013 at 9:45 PM
What If All User Interface (UI) Data Came In Reports?
@Jonah, As I was reading what you wrote, it occurred to me that maybe I do something similar to that in some of my client-side code. In an application I'm working on, there are a bunch of unrelated ... read »
Jun 17, 2013 at 9:36 PM
Object Thinking By David West
@Jonah, Please, don't feel bad at all. I appreciate all that you have contributed to the conversation. And, the more points of view I get, the more confident I am that I will some day, some how und ... read »
Jun 17, 2013 at 9:32 PM
Object Thinking By David West
@Paul, I definitely have a mental hurdle when it comes to discovering better design over time. My brain has this insane urge to just understand how you do something right the first time :) But, eve ... read »
Jun 17, 2013 at 9:29 PM
SOTR 2013 - The Best Conference I Never Went To
I just had to watch this again - amazing :) ... read »
Jun 17, 2013 at 9:28 PM
Working With Inherited Collections In AngularJS
@Ali, You are right - it is confusing. I should have just named it "saveForm()" or "submitForm()" or something to that effect. Then, the saveForm() method could have simply vali ... read »
Jun 17, 2013 at 9:27 PM
Working With Inherited Collections In AngularJS
@Samuel, Good question - that was also bothering me when I wrote the code. Yes, I could have moved it up into AppController. The reason that I didn't for this demo was that I didn't want the AppCon ... read »
Jun 17, 2013 at 9:23 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
@Josh, My pleasure. It was fun to learn more about this stuff. @Chebby, Will do - we're gonna be moving some stuff over to S3, so I am sure I'll be learning all sorts of interesting things / use ... read »
Jun 17, 2013 at 4:21 PM
Experimenting With The Amazon Simple Storage Service (S3) API Using ColdFusion
Thanks Ben. Would love to see more CF/S3 examples! ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools