Uncategorized

MT Blog Search Bookmarklet

I am a bit amazed I never thought of this earlier… the primary use for CogDogBlog is pure selfish- tracking things or projects so I can have a record I can find later. More often than not, i am trying to remember a site or reference from a few months/years back, and the only way to look for it is go to my, ahem, overloaded main page, and using the search form.

But in the last 15 minutes, I wrote a quick little JavaScript that allows me to do a quick search and bypass the main page. Actually I ripped it pretty much from the Google Browser Buttons, which does a quick Google search on any highlighted text for a page in view, or if no text is selected, provides a pop up box to type in the search words. A dull beam of light said tonight– “hey, I could do that for my MovableType Blog!”

So here it is, just drag the link to your browser toolbar, and you have direct search to CDB:

Want to roll your own? You just need to create an empty bookmark/favorite, copy the code below, and make appropriate edits to personalize it.

with 3 edits needed shown in bold:

javascript:t=getSelection();if(!t)%7Bvoid
[1] (t=prompt('search%20CogDogBlog%20for...',''))
    %7D;if(t)%20location.href='
[2] http://jade.mcli.dist.maricopa.edu/cgi-bin/mt/mt-search.cgi?
[3] IncludeBlogs=1&search='%20+%20escape(t);

[1] Customize the name of your blog for the pop up keyword entry
[2] Customize the URL for your MT search script
[3} Customize the database ID number for your blog for the value of IncludeBlogs

If you are unsure of the values for [2] and [3]. just look at the URL produced by any search performed from the normal MT search form.

Your mileage may vary, but this will save me a few steps from searching my own blog.

For that matter, you can also exploit knowledge of the URL produced by search results to create links within your blogs to key words that are not necessarily your predefined categories. For example, I can easily add links if I wished to, say a collection to mythical entities (there is a poor joke in this):

Knowing how to pick apart search URLs opens up all kinds of doors…. never be afraid to dissect a URL.

If this kind of stuff has value, please support me by tossing a one time PayPal kibble or monthly on Patreon
Become a patron at Patreon!
Profile Picture for CogDog The Blog
An early 90s builder of web stuff and blogging Alan Levine barks at CogDogBlog.com on web storytelling (#ds106 #4life), photography, bending WordPress, and serendipity in the infinite internet river. He thinks it's weird to write about himself in the third person. And he is 100% into the Fediverse (or tells himself so) Tooting as @cogdog@cosocial.ca