Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 107 lines (107 sloc) 5.385 kb
0e5c532 @codepo8 php version
authored
1 <?php
f3517de @codepo8 added disclaimer
authored
2 /*
3 GooHooBi by Christian Heilmann
4 Homepage: http://github.com/codepo8/GooHooBi
5 Copyright (c)2009,2010 Christian Heilmann
6 Code licensed under the BSD License:
7 http://wait-till-i.com/license.txt
8 */
0e5c532 @codepo8 php version
authored
9 $search = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_SPECIAL_CHARS);
10 ?>
11 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
12 "http://www.w3.org/TR/html4/strict.dtd">
13 <html>
14 <head>
15 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
16 <title>GooHooBi - search Google, Yahoo and Bing in one go!</title>
17 <link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/reset-fonts-grids/reset-fonts-grids.css" type="text/css">
18 <link rel="stylesheet" href="http://yui.yahooapis.com/2.7.0/build/base/base.css" type="text/css">
19 <style type="text/css" media="screen">
20 html,body{color:#fff;background:#222;font-family:calibri,verdana,arial,sans-serif;}
21 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;}
22 h3 a{color:#69c;text-decoration:none;}
f3517de @codepo8 added disclaimer
authored
23 form{font-size:150%;margin-top:-3.2em;}
0e5c532 @codepo8 php version
authored
24 h1{font-size:300%;margin:0;text-align:right;color:#3c3}
25 ul,ul li{margin:0;padding:0;list-style:none;}
26 p span{display:block;text-align:right;margin-top:.5em;font-size:90%;color:#999;}
27 input[type=text]{-moz-border-radius:5px;-webkit-border-radius:5px;border:1px solid #fff;padding:3px;}
28 input[type=submit]{-moz-border-radius:5px;-webkit-border-radius:5px;border:2px solid #3c3;background:#3c3}
29 .info{font-size:200%;color:#999;margin:1em 0;}
f9fe719 @codepo8 php version
authored
30 .smallinfo{font-size:120%;color:#999;margin:1em 0;}
0e5c532 @codepo8 php version
authored
31 #ft p{color:#666;text-align:right;}
32 #ft a{color:#ccc;}
33 #yahoo a{color:#c6c;}
34 #yahoo h2{background:#c6c;}
35 #bing h2{background:#fc6;}
36 #bing a{color:#fc6;}
37 h3{margin:0 0 .2em 0}
f9fe719 @codepo8 php version
authored
38 #modeswitch{text-align:right;}
39 #modeswitch a{color:#fff;}
f3517de @codepo8 added disclaimer
authored
40 h2#resultsheader,h2#preview{background:#000;padding:2px 5px;color:#fff;margin:1em 0 0 0;font-weight:bold;-moz-box-shadow:none;-moz-border-radius:0;-webkit-border-radius:0;text-shadow:none;}
f9fe719 @codepo8 php version
authored
41 <?php if(isset($_GET['research'])){?>
42 #results{height:200px;overflow:auto;}
43 iframe{display:block;width:100%;border:none;margin:0 0 1em 0;height:400px;}
f3517de @codepo8 added disclaimer
authored
44 #results ul,#results h2{margin-right:.5em;}
f9fe719 @codepo8 php version
authored
45 <?php }?>
0e5c532 @codepo8 php version
authored
46 </style>
47 </head>
48 <body>
f9fe719 @codepo8 php version
authored
49 <div id="<?php echo (isset($_GET['research']))?'doc2':'doc'?>" class="yui-t7">
50 <div id="hd" role="banner"><h1>GooHooBi</h1><p id="modeswitch">Mode <?php echo (isset($_GET['research']))?'<a href="index.php">simple</a>':'<strong>simple</strong>'?> - <?php echo (!isset($_GET['research']))?'<a href="index.php?research">research</a>':'<strong>research</strong>'?></p></div>
0e5c532 @codepo8 php version
authored
51 <div id="bd" role="main">
52 <form action="index.php" method="get" id="mainform">
53 <div>
54 <label for="search">Search:</label>
55 <input type="text" id="search" name="search" value="<?php echo $search;?>">
56 <input type="submit" value="Go!">
57 </div>
58 </form>
f9fe719 @codepo8 php version
authored
59 <?php if(!isset($_GET['research'])){?>
60 <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>
61 <?php }?>
62 <?php if(isset($_GET['research'])){?>
63 <p class="smallinfo">This is GooHooBi in research mode. If you click on links in the results the page will open in the same interface.</p>
f3517de @codepo8 added disclaimer
authored
64 <h2 id="resultsheader">Search results</h2>
f9fe719 @codepo8 php version
authored
65 <?php }?>
0e5c532 @codepo8 php version
authored
66 <div id="results">
67 <?php if(isset($_GET['search'])){
68 include('goohoobi.php');
69 }?>
70 </div>
f9fe719 @codepo8 php version
authored
71 <?php if(isset($_GET['research'])){?>
72 <h2 id="preview">Web preview</h2>
73 <iframe name="fr" id="fr"></iframe>
74 <?php }?>
0e5c532 @codepo8 php version
authored
75 </div>
1e24c4c @codepo8 added multisearch
authored
76 <div id="ft" role="contentinfo"><p>Written by <a href="http://wait-till-i.com">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>
0e5c532 @codepo8 php version
authored
77 </div>
78 <script type="text/javascript" charset="utf-8">
79 goohoobi = function(){
80 var results = document.getElementById('results');
81 function seed(o){
82 results.innerHTML = o.result;
83 }
84 function doSearch(){
85 results.innerHTML = '<div class="yui-gb">\
86 <div class="yui-u first" id="google">\
87 <h2>Google loading &hellip;</h2></div>\
88 <div class="yui-u" id="yahoo"><h2>Yahoo loading &hellip;</h2></div>\
89 <div class="yui-u" id="bing"><h2>Bing loading &hellip;</h2></div>\
90 </div>';
91 var query = document.getElementById('search').value;
92 var s = document.createElement('script');
f9fe719 @codepo8 php version
authored
93 <?php if(isset($_GET['research'])){?>
94 var research = '&research=true';
95 <?php }?>
96 s.setAttribute('src','goohoobi.php?search='+query+'&json=true'+research);
0e5c532 @codepo8 php version
authored
97 document.getElementsByTagName('head')[0].appendChild(s);
98 }
99 document.getElementById('mainform').onsubmit = function(){
100 doSearch();
101 return false;
102 }
f3517de @codepo8 added disclaimer
authored
103 return {se:seed}
0e5c532 @codepo8 php version
authored
104 }();
105 </script>
106 </body>
107 </html>
Something went wrong with that request. Please try again.