Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
132 lines (130 sloc) 5.81 KB
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GooHooBi - search Google, Yahoo and Bing in one go!</title>
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
<link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/base/base.css" type="text/css">
<style type="text/css" media="screen">
html,body{color:#fff;background:#222;font-family:calibri,verdana,arial,sans-serif;}
h2{background:#369;padding:5px;color:#fff;font-weight:bold;-moz-box-shadow: 0px 4px 2px -2px #000;-moz-border-radius:5px;-webkit-border-radius:5px;text-shadow: #000 1px 1px;}
h3 a{color:#69c;text-decoration:none;}
form{font-size:150%;margin-top:-1.8em;}
h1{font-size:300%;margin:0;text-align:right;color:#3c3}
ul,ul li{margin:0;padding:0;list-style:none;}
p span{display:block;text-align:right;margin-top:.5em;font-size:90%;color:#999;}
input[type=text]{-moz-border-radius:5px;-webkit-border-radius:5px;border:1px solid #fff;padding:3px;}
input[type=submit]{-moz-border-radius:5px;-webkit-border-radius:5px;border:2px solid #3c3;background:#3c3}
.info{font-size:200%;color:#999;margin:1em 0;}
#ft p{color:#666;text-align:right;}
#ft a{color:#ccc;}
#yahoo a{color:#c6c;}
#yahoo h2{background:#c6c;}
#bing h2{background:#fc6;}
#bing a{color:#fc6;}
h3{margin:0 0 .2em 0}
</style>
</head>
<body>
<div id="doc" class="yui-t7">
<div id="hd" role="banner"><h1>GooHooBi</h1></div>
<div id="bd" role="main">
<form action="" method="post" id="mainform">
<div>
<label for="search">Search:</label>
<input type="text" id="search" name="search">
<input type="submit" value="Go!">
</div>
</form>
<p class="info">GooHooBi allows you to search Google, Yahoo and Bing in one go. Simply add your search term above and hit the Go button.</p>
<div class="yui-gb">
<div class="yui-u first" id="google"></div>
<div class="yui-u" id="yahoo"></div>
<div class="yui-u" id="bing"></div>
</div>
</div>
<div id="ft" role="contentinfo"><p>Written by <a href="http://wait-till-i.con">Chris Heilmann</a>, powered by <a href="http://developer.yahoo.com/yui">YUI</a> and <a href="http://developer.yahoo.com/yql/console/?q=select%20*%20from%20query.multi%20where%20queries%3D%27%0A%20%20select%20Title%2CDescription%2CUrl%2CDisplayUrl%20%0A%20%20%20%20from%20microsoft.bing.web%2820%29%20where%20query%3D%22cat%22%3B%0A%20%20select%20title%2Cclickurl%2Cabstract%2Cdispurl%20%0A%20%20%20%20from%20search.web%2820%29%20where%20query%3D%22cat%22%3B%0A%20%20select%20titleNoFormatting%2Curl%2Ccontent%2CvisibleUrl%20%0A%20%20%20%20from%20google.search%2820%29%20where%20q%3D%22cat%22%0A%27&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys">YQL</a>.</p></div>
</div>
<script type="text/javascript" charset="utf-8">
goohoobi = function(){
var bing = document.getElementById('bing');
var google = document.getElementById('google');
var yahoo = document.getElementById('yahoo');
function seed(o){
if(o.query.results.results[0]){
var res = o.query.results.results[0].WebResult;
var all = res.length;
var out = '<h2>Bing</h2><ul>';
for(var i=0;i<all;i++){
out += '<li><h3><a href="'+res[i].Url+'">'+res[i].Title+'</a></h3><p>'+
res[i].Description+'<span>('+res[i].DisplayUrl+
')</span></p></li>';
}
out += '</ul>';
bing.innerHTML = out;
} else {
bing.innerHTML = '<h2>Bing</h2><ul><li>\
<h3>No results found. </h3></li></ul>';
};
if(o.query.results.results[1]){
var res = o.query.results.results[1].result;
var all = res.length;
var out = '<h2>Yahoo</h2><ul>';
for(var i=0;i<all;i++){
out += '<li><h3><a href="'+res[i].clickurl+'">'+res[i].title+
'</a></h3><p>'+res[i].abstract+'<span>('+res[i].dispurl+
')</span></p></li>';
}
out += '</ul>';
yahoo.innerHTML = out;
}else{
yahoo.innerHTML = '<h2>Yahoo</h2><ul><li>\
<h3>No results found. </h3></li></ul>';
}
if(o.query.results.results[2]){
var res = o.query.results.results[2].results;
var all = res.length;
var out = '<h2>Google</h2><ul>';
for(var i=0;i<all;i++){
out += '<li><h3><a href="'+res[i].url+'">'+res[i].titleNoFormatting+
'</a></h3><p>'+res[i].content+'<span>('+res[i].visibleUrl+
')</span></p></li>';
}
out += '</ul>';
google.innerHTML = out;
}else{
google.innerHTML = '<h2>Google</h2><ul><li>\
<h3>No results found. </h3></li></ul>';
}
}
function doSearch(){
google.innerHTML = '<h2>Google loading...</h2>';
bing.innerHTML = '<h2>Bing loading...</h2>';
yahoo.innerHTML = '<h2>Yahoo loading...</h2>';
var query = document.getElementById('search').value;
var url = 'select * from query.multi where queries=\'select '+
'Title,Description,Url,DisplayUrl from microsoft.bing.web(20) '+
'where query="'+query+'";select title,clickurl,abstract,'+
'dispurl from search.web(20) where query = "'+query+'";'+
'select titleNoFormatting,url,content,visibleUrl '+
'from google.search(20) where q = "'+query+'"\'';
var api ='http://query.yahooapis.com/v1/public/yql?q='+
encodeURIComponent(url)+'&format=json&env=store'+
'%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback='+
'goohoobi.se&diagnostics=false';
var s = document.createElement('script');
s.setAttribute('src',api);
document.getElementsByTagName('head')[0].appendChild(s);
}
document.getElementById('mainform').onsubmit = function(){
doSearch();
return false;
}
return {
se:seed
}
}();
</script>
</body>
</html>
You can’t perform that action at this time.