forked from codepo8/GooHooBi
/
goohoobi.html
132 lines (130 loc) · 5.81 KB
/
goohoobi.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!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>