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 »
10,640 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 »
10,640 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 »
10,640 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
InVision App - Prototyping Made Beautiful With Prototyping Tools Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
Feb 10, 2012 at 7:21 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
Update! Instead of $(eval(options.insertAfter)).after(data['insertData']); I now use: var ajaxNode = document.createElement('span'); var parent = $(eval(options.insertAfter))[0].parentNode; ... read »
Feb 10, 2012 at 6:18 PM
jQuery AJAX Strips Script Tags And Inserts Them After Parent-Most Elements
encountered this same, what I consider, jQuery bug last week. I'm building a site in which I load some content via AJAX. This content contains Linkedin share button placeholders which Linkedin API ne ... read »
Feb 10, 2012 at 11:30 AM
Cross-Origin Resource Sharing (CORS) AJAX Requests Between jQuery And Node.js
After you understand the concepts here, this is an awesome cheatsheet for enabling CORS in just about anything http://enable-cors.org/ ... read »
JM
Feb 10, 2012 at 9:10 AM
My Safari Browser SQLite Database Hello World Example
@Amy, Here is a very good tutorial on how to use JOIN: http://www.sqltutorial.org/sqljoin-innerjoin.aspx ... read »
Feb 10, 2012 at 4:42 AM
Building A Twitter-Inspired RESTful API Architecture In ColdFusion
This is great, very useful Ben. I spotted a small typo in the api.cgm listing: <cfthrow type="Unauthroized" /> Cheers Stefan ... read »
Feb 9, 2012 at 10:35 PM
CFDirectory Filtering Uses Pipe Character For Multiple Filters (Thanks Steve Withington)
I was wondering if there would be a filter you could apply so that you got everything but what you included in the filter. As in show me all docs that are not a .pdf. ... read »
Feb 9, 2012 at 10:29 PM
Learning ColdFusion 9: Application-Specific Data Sources
@Ben, No offence, but if people were really wanting advanced features they would be using a platform like ASP.NET MVC. CFML is so structurally compromised as a tag-based scripting language that ... read »
Feb 9, 2012 at 10:03 PM
Subversion - Cleanup Failed To Process The Following Paths
@Leviaguirre, do you still have problems with this? ... read »