Archive for March 25th, 2005

Make your Blog Googable!

Friday, March 25th, 2005

You know, after even just a few posts it can get a it tedious to find information that has been posted in your blog in the past. One way around this is to add a google search to your blog. That saves you the time and effort of having to create your own search utility.

To do this, you need a few things:

Now that you have that, you’ll need to customize the search code a bit. Lets start with the base code (I’ll use the safe search code):

<!-- Google SafeSearch  --><center> <form method="get" action="http://www.google.com/search">  <input name="ie" value="UTF-8" type="hidden">  <input name="oe" value="UTF-8" type="hidden">  <input name="safe" value="strict" type="hidden">  <table bgcolor="#ffffff">   <tbody>    <tr>     <td>      <a href="http://www.google.com/search?safe=vss">       <img src="http://www.google.com/logos/Google_Safe.gif" alt="Google" align="middle" border="0" height="45" width="115" />      </a>            <input name="q" size="25" maxlength="255" value="" type="text">            <input name="sa" value="Google Search" type="submit">          </td>        </tr>      </tbody>  </table> </form></center><!-- Google SafeSearch -->

For my purposes I got rid of some ‘unnecessary’ things like the Google logo and reduced the button text to ‘->’. The main reason for this is saving space. I also added another form field that instructs google to search my blog site only:

<!-- Google SafeSearch  --><center>  <form method="get" action="http://www.google.com/search">    <input name="ie" value="UTF-8" type="hidden">    <input name="oe" value="UTF-8" type="hidden">    <input name="q" size="25" maxlength="255" value="" type="text">    <input name="safe" value="strict" type="hidden">    <input name="sitesearch" value="eureka.emmgee.com" type="hidden">    <input name="sa" value="->" type="submit">  </form></center><!-- Google SafeSearch -->

Google away, mateys!