So you would like to add Technorati Search to your site, but you can't because you don't have full control over the html in your blog. Like me a good example of this would be blogs on .Text. The code given to you by Technorati is a form, which doesn't work in .Text. I really want to add Technorati Search to my blog. I used my Adding Search to my blog the MSN Search Beta way as a template. So I went from what Technorati gave me and created a Technorati Search that will work for me. Hopefully David Sifry doesn't mind what I have done.
Here it is:
<fieldset style="padding:4px">
<legend><a href="http://technorati.com/">Technorati</a> search</legend>
<input style="width:12em" type="text" name="url" maxlength="255" value="" onkeypress="return TechnoratiSearch(event, this);"/>
<label style="display:block;padding-top:3px" for="ts_yb" title="Edgardo Vega\'s Blog">
<input type="radio" checked="checked" name="from" id="ts_yb" value="http://www.geekswithblogs.com/evega/" />
this blog</label>
<label style="margin-right:.2em" for="ts_www">
<input type="radio" name="from" id="ts_www" value="" /> all blogs</label>
<input type="button" value="Search" onclick="return TechnoratiSearch2('url');" class="search" />
</fieldset>
<script type="text/javascript">
function TechnoratiSearch(event, oInput) {
var keyCode = (event) ? event.keyCode : keyStroke.which;
if (keyCode == 13) {
if (eval("document.forms[0].from[0].checked") == false)
{
top.location = 'http://www.technorati.com/cosmos/search.html?sub=searchlet&url=' + escape(oInput.value.replace(/ /g, "+"));
}
else
{
s = escape(document.forms[0].from[0].value.replace(/:/g, unescape('%3A')))
s = s.replace(/\//g, '%2F');
top.location = 'http://www.technorati.com/cosmos/search.html?sub=searchlet&url=' + escape(oInput.value.replace(/ /g, "+")) + '&from=' + s;
}
return false;
} return true;
}
function TechnoratiSearch2(oInputId) {
var oInput = document.getElementById(oInputId);
if (eval("document.forms[0].from[0].checked") == false)
{
top.location = 'http://www.technorati.com/cosmos/search.html?sub=searchlet&url=' + escape(oInput.value.replace(/ /g, "+"));
}
else
{
s = escape(document.forms[0].from[0].value.replace(/:/g, unescape('%3A')))
s = s.replace(/\//g, '%2F');
top.location = 'http://www.technorati.com/cosmos/search.html?sub=searchlet&url=' + escape(oInput.value.replace(/ /g, "+")) + '&from=' + s;
}
return false;
}
</script>
To get it to work for you blog change the following:
<label style="display:block;padding-top:3px" for="ts_yb" title="Edgardo Vega\'s Blog"> Change the title to your blog's title
<input type="radio" checked="checked" name="from" id="ts_yb" value="http://www.geekswithblogs.com/evega/" /> Change the value to the link to your blog
After that you should be ready to go. ENJOY!