adding a google search box

Google has finally killed their old search API

I had a old Google search code, like this, from i think ~2001 or so:

<div class="xahlee-search">
<form method="get" action="http://www.google.com/custom">
<div>
<a href="http://www.google.com/">
<img style="border:none" src="http://www.google.com/uds/css/small-logo.png" alt="Google">
</a>
<input type="hidden" name="domains" value="xahlee.org">
<input type="text" name="q" size="31" maxlength="255" value="Search XahLee.org here" onclick="javascript:select();">
<input type="submit" name="sa" value="Search">
<input type="hidden" name="sitesearch" value="xahlee.org">
<input type="hidden" name="forid" value="1">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;">
<input type="hidden" name="hl" value="en">
</div>
</form>
</div>

About 2 weeks ago, Google killed it. When you use that to search, it returns:

We're sorry...

... but your computer or network may be sending automated queries. To protect our users, we can't process your request right now.

See Google Help for more information.

The proper way to add a Google search box is to use their new API. I've written how and updated it here: Adding Google Search to Your Website.

Adding a XahLee.org Search Box to Your Site

You can also add a XahLee.org Search Box to your site. For the code, see bottom of: Subscribe To XahLee.org Site Feed.

Popular posts from this blog

Browser User Agent Strings 2012

11 Years of Writing About Emacs

does md5 creates more randomness?