Shorthand Notation For Searching BenNadel.com

Posted February 2, 2007 at 12:22 PM

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.

Comments (7)  |  Post Comment  |  Ask Ben  |  Permalink  |  Print Page



Adobe ColdFusion 8.0.1 Update - Helping Programmers To Be Signifanctly Less Girlie - Download ColdFusion 8 Update 8.0.1 Now.

Reader Comments

Nice, what did you use to do it?

Posted by Boyan on Feb 2, 2007 at 12:57 PM


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.

Posted by Ben Nadel on Feb 2, 2007 at 1:55 PM


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

Posted by Boyan on Feb 2, 2007 at 2:07 PM


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);}}})();

Posted by Boyan on Apr 13, 2007 at 8:48 AM


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

Posted by Ben Nadel on Apr 13, 2007 at 8:52 AM


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);}}})();

Posted by Boyan on Apr 13, 2007 at 8:58 AM


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

Posted by Ben Nadel on Apr 13, 2007 at 9:00 AM


Post Comment  |  Ask Ben


Home   |   Web Log   |   ColdFusion   |   Projects   |   Resume   |   Job Form   |   Search   |   Contact
Epicenter Consulting - Custom Software Solutions for Business Evolution HostMySite.com - The Leader In ColdFusion Hosting