Guess I'll be a nice guy. This is a basic google script I made.

It's triggered with !g (search stuff)
You can trigger the script yourself
You can also use /g (search stuff) and it will echo the results to only you
It only returns 1 result, it doesn't do math or any extra features the google website does, it only does basic results
create a variable %chan_whitelist with a list of chans separated by spaces for chans you wish to have the script work in, Ex: %chan_whitelist #pball #lladq
If you want it to work in all chans remove the line "if (!$istok(%chan_whitelist,$chan,32)) halt"
There is a limit of 1 search every 5 seconds for spam protection, that can be changed in this line "else set -u5 %googlespam 1" by editing -u# to a different number


on *:TEXT:!g *:#: google_start $chan $$2-

on *:input:*: if (!$ctrlenter) && (!$inpaste) && ($left($1,1) != $readini(mirc.ini,text,commandchar) || $1 != /msg || $1 != /me) && ($1 == !g) google_start $chan $$2-

alias g {
  google_start nchan $$1-

alias google_start {
  if (!$istok(%chan_whitelist,$chan,32)) return
  if (%googlespam) halt 
  else set -u5 %googlespam 1
  if ($1 != nchan) set %google.chan $v1
  set %google.url /custom?hl=en&client=pub-4099951843714863& $+ $web_input($2-) $+ &btnG=Search
  sockopen google 80

on *:SOCKOPEN:google:{
  sockwrite -nt $sockname GET %google.url HTTP/1.1
  sockwrite -nt $sockname HOST:
  sockwrite -n $sockname

on *:SOCKREAD:google: {
  if ($sockerr > 0) { echo -a Error while reading from $sockname $+ . | echo -a Error # $+ $sockerr occurred. | return }
  while ($sockbr) {
    if ($regex(g,,/<a class="l" href="(.*?)".*?">(.*?)</a></h2>.*?<span class="s">(.*?)</span><br>/)) {
      $iif(%google.chan,msg $v1,echo -a) 7Result: $parsehtml($regml(g,2)) 7Link: $parsehtml($regml(g,1))
      $iif(%google.chan,msg $v1,echo -a) 7Description: $parsehtml($regml(g,3))
      set -l %done 1
    if (%done) { sockclose google | unset %google.* }

alias -l web_input { return $replacex($1-,?,$+(%,3F),@,$+(%,40),#,$+(%,23),$,$+(%,24),%,$+(%,25),^,$+(%,5E),&,$+(%,26),+,$+(%,2B),=,$+(%,3D),`,$+(%,60),[,$+(%,5B),],$+(%,5D),\,$+(%,5C),$chr(123),$+(%,7B),$chr(125),$+(%,7D),|,$+(%,7C),$chr(59),$+(%,3B),',$+(%,27),:,$+(%,3A),",$+(%,22),$chr(44),$+(%,2C),/,$+(%,2F),<,$+(%,3C),>,$+(%3E),$chr(32),$+(%,20)) }

alias -l parsehtml {
  set -l %temp $regsubex($1,/<[^>]+[>$]>?/g,)
  while (($regex(%temp,/&#(\d+);/)) && ($regml(1) isnum 32-255)) set -l %temp $replacex(%temp,$+(&#,$regml(1),;),$chr($regml(1)))
  while (($regex(%temp,/&#x(.*?);/)) && ($base($regml(1),16,10) isnum 32-255)) set -l %temp $replacex(%temp,$+(&#x,$regml(1),;),$chr($base($regml(1),16,10)))
  set -l %finished $replacex(%temp,&nbsp;,$chr(160),&quot;,",&middot;,,&lt;,<,&gt;,>,&amp;,&,&ndash;,,&eacute;,$chr(233))
  return %finished

No guarantees on this working forever, but with the particular method this uses it shouldn't change and stop working much hopefully. Just message me here if the script stops working.

Last edited by pball; 08/11/11 08:03 PM.
My personal site with some scripts I've released.