gfxgfxMaximum CPU Forumsgfxgfx
gfx gfx
gfx
Welcome, Guest. Please login or register.
May 21, 2012, 06:46:16 PM

Login with username, password and session length
gfx
gfx
*
gfxgfx
gfxgfx gfxgfx
Search:     Advanced search
gfxgfx Home Help Search Login Register   gfxgfx
gfx gfx
gfx
Pages: [1]
Print
Author Topic: Bash Style Google  (Read 2842 times)
acemaverick1381
Extreme Overclocker
****
Offline Offline

Posts: 352


View Profile WWW
« on: March 17, 2005, 09:03:28 AM »

This is what happens when a coder is sick for three days, and is tired of coding everything else. He reads a thread on a forum, and notices that there was a Mac OSX style Google. That gives him the idea, why not a Bash style Google? With nothing better to do at 7 AM in the morning, and his eyes red of sickness, he pulls open VIM, Firefox, and SSH's into his server. And look what happened...
http://www.elvenrealms.net/ace/weeklyscrip.../googlebash.php

(Looks best in Mozilla/Firefox/Netscape)

And of course, the source:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<HTML>
<HEAD>
 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=us-ascii">
 <TITLE>
  Ace's Bash Google Search
 </TITLE>
</HEAD>
<BODY BGCOLOR="black">

 <?php
  $getSearch = $_POST['search'];

  if ($getSearch != "")
   {
    $searchLen = strlen($getSearch);
    $getSearch = str_replace("-l ", "", $getSearch);
 
    if ($searchLen == strlen($getSearch))
     {
      $searchString = "http://www.google.com/search?hl=en&lr=&q=$getSearch&btnG=Search";
     }

    if ($searchLen != strlen($getSearch))
     {
      $searchString = "http://www.google.com/search?hl=en&q=$getSearch&btnI=I%27m+Feeling+Lucky";
     }

    echo "<script LANGUAGE=\"JavaScript\" TYPE=\"text/javascript\">\n";
    echo " document.location = \"$searchString\";\n";
    echo "</SCRIPT>\n";
    exit;
   }
 ?>

 <IMG SRC="tux.png" ALT="tux">
 <BR>

 <DIV ID="mount">
  <FONT COLOR="silver">
  <TT><B>
   Mounting Browser
  </B></TT>
  </FONT>
 </DIV>

 <DIV ID="browser" STYLE="visibility: hidden;">
  <FONT COLOR="silver">
  <TT><B>
   <script LANGUAGE="JavaScript" TYPE="text/javascript">
    document.write(navigator.userAgent);
   </SCRIPT>
  </B></TT>
  </FONT>
 </DIV>

 <DIV ID="dhcp" STYLE="visibility: hidden;">
  <FONT COLOR="silver">
  <TT><B>
   <?php
    echo "Broadcasting DHCP Discover " . $_SERVER['REMOTE_ADDR'];
   ?>
  </B></TT>
  </FONT>
 </DIV>

 <DIV ID="loadbash" STYLE="visibility: hidden;">
  <FONT COLOR="silver">
  <TT><B>
   Loading Google Bash
  </B></TT>
  </FONT>
 </DIV>

 <DIV ID="blackloadbox" STYLE="height: 10px; width: 150px; background-color: black; border: thin solid Silver; visibility: hidden;">
  <DIV ID="greenloadbox" STYLE="height: 10px; width: 0px; background-color: lime;">
  </DIV>
 </DIV>

 <P>

 <DIV ID="inputbash" STYLE="visibility: hidden;">
  <FORM NAME="searchgoogle" METHOD="post" ACTION="">
   <FONT COLOR="silver">
   <TT><B>
    "-l search query" For I'm Feeling Lucky
  
    <BR>

    bash-2.05$
    <INPUT TYPE="text" NAME="search" STYLE="color: Silver; font-family: Courier; height: 20px; background-color: black; border: none;">
    <INPUT TYPE="submit" VALUE="Search" STYLE="visibility: hidden;">
   </B></TT>
   </FONT>
  </FORM>
 </DIV>

 <script LANGUAGE="JavaScript" TYPE="text/javascript">
  var loadWidth = 0;
  var timerFlag = 0;

  function ShowBrowser()
   {
    timeout = setTimeout("ShowBrowser()", 100);
    timerFlag++;

    if (timerFlag == 10)
     {
      timerFlag = 0;
      clearTimeout(timeout);    
      document.getElementById('browser').style.visibility = "visible";
      ShowDHCP();
     }  
   }

  function ShowDHCP()
   {
    timeout = setTimeout("ShowDHCP()", 100);
    timerFlag++;

    if (timerFlag == 15)
     {
      clearTimeout(timeout);
      document.getElementById('dhcp').style.visibility = "visible";
      document.getElementById('loadbash').style.visibility = "visible";
      document.getElementById('blackloadbox').style.visibility = "visible";
      LoadBash();
     }
   }
 
  function LoadBash()
   {
    timeout = setTimeout("LoadBash()", 50);
    loadWidth += 5;
    document.getElementById('greenloadbox').style.width = loadWidth;

    if (loadWidth == 150)
     {
      document.getElementById('inputbash').style.visibility = "visible";
      document.searchgoogle.search.focus();
      clearTimeout(timeout);
     }
   }

  ShowBrowser();
 </SCRIPT>

</BODY>
</HTML>
Logged

neb1211
Administrator
Overclocker Elite
*****
Offline Offline

Posts: 796



View Profile WWW
« Reply #1 on: March 17, 2005, 06:27:47 PM »

that is pretty cool but one question.  Shouldn't you be sleeping if you are sick ?  Tongue  
Logged

acemaverick1381
Extreme Overclocker
****
Offline Offline

Posts: 352


View Profile WWW
« Reply #2 on: March 17, 2005, 07:16:13 PM »

Well, I tried to sleep last night, and I only got 3 hours so I figure if my body wants to sleep, I'm not going to tell it to. I'm just going to have to pass out and fall out of my chair.
Logged

Pages: [1]
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2011, Simple Machines LLC
Cerberus design by Bloc
Valid XHTML 1.0! Valid CSS!
gfx
gfxgfx gfxgfx