!google search

By Master-Of-Death on Jan 14, 2010

Paste and save it into your remotes.

Syntax: !google

(Not the best google search script I could have made but still ok.)

on *:TEXT:!google*:#:{
  set %url /custom?hl=en&client=pub-4099951843714863&cof=FORID%3A1%3BGL%3A1%3BS%3Ahttp%3A%2F%2Fwww.hyperwords.net%2F%3BL%3Ahttp%3A%2F%2Fwww.hyperwords.net%2Fhy-for-google.gif%3BLH%3A100%3BLW%3A100%3BLBGC%3AFFFFFF%3BLP%3A1%3BLC%3A%230033cc%3BVLC%3A%23333333%3BGALT%3A%23999999%3B&q= $+ $2- $+ &btnG=Search
  set %chan $chan
  set %google (http://\S+.\S+.(com|co\.uk|org|ca|au)\S+)
  sockopen google www.google.com 80
}
on *:SOCKOPEN:google:{
  sockwrite -n $sockname GET %url HTTP/1.0
  sockwrite -n $sockname HOST: www.google.com $+ $crlf $+ $crlf 
}
on *:SOCKREAD:google:{
  sockread %googlelink
  if (%google1 == 3) { 
    unset %google1
    sockclose $sockname
    halt
  }
  elseif ($regex(google,%googlelink,%google)) && (google !isin $regml(google,1)) {
    inc %google1 1
    msg %chan 4Search Result: 12 $remove($regml(google,1),")
  }
}

Comments

Sign in to comment.
cptpan   -  Jul 08, 2012

This thing fuked out hard

 Respond  
^WeSt   -  Nov 11, 2011

Not working to me, also an error appeared.

  • /sockopen: 'google' socket in use (line 1345, test.mrc)

You have to update it into :
[b]sockclose google
sockopen google www.google.com 80[/b]

 Respond  
PyThOn   -  Nov 11, 2011

...............

 Respond  
Stewie1k94   -  Nov 09, 2011

I only just noticed the comment, when looking at this script.

 Respond  
Jethro   -  Nov 08, 2011

It's a little late now, and I don't want to spoil it.

 Respond  
Stewie1k94   -  Nov 08, 2011

Could u tell my sarcasm? :P

 Respond  
Jethro   -  Oct 05, 2011

toclafane1, this script is not so cool as you think. It needs improving. :::shrugs:::

 Respond  
Stewie1k94   -  Oct 05, 2011

cool script

 Respond  
Jethro   -  Oct 05, 2011

Well, it wasn't my fault. I thought you wanted an alias command. It's easy to do by adding an on input event like so:

on *:TEXT:!google *:#: google $2-
on *:INPUT:#: if ($1 == !google) google $2-
alias -l google {
  set %url /custom?hl=en&client=pub-4099951843714863&cof=FORID%3A1%3BGL%3A1%3BS%3Ahttp%3A%2F%2Fwww.hyperwords.net%2F%3BL%3Ahttp%3A%2F%2Fwww.hyperwords.net%2Fhy-for-google.gif%3BLH%3A100%3BLW%3A100%3BLBGC%3AFFFFFF%3BLP%3A1%3BLC%3A%230033cc%3BVLC%3A%23333333%3BGALT%3A%23999999%3B&q= $+ $1- $+ &btnG=Search
  set %chan $chan
  set %google (http://\S+.\S+.(com|co\.uk|org|ca|au)\S+)
  sockopen google www.google.com 80
}
on *:SOCKOPEN:google:{
  sockwrite -n $sockname GET %url HTTP/1.0
  sockwrite -n $sockname HOST: www.google.com $+ $crlf $+ $crlf
}
on *:SOCKREAD:google:{
  sockread %googlelink
  if (%google1 == 3) {
    unset %google1
    sockclose $sockname
    halt
  }
  elseif ($regex(google,%googlelink,%google)) && (google !isin $regml(google,1)) {
    inc %google1 1
    msg %chan 4Search Result: 12 $remove($regml(google,1),")
  }
}
 Respond  
konbon   -  Oct 05, 2011

@jethro: I should have been more specific.
What i wanted to do was be able to use the script myself in the channel.
If i type !google hawkee from the same client that the script is on, i would like it to show me results as well, in the channel. If Possible. Thanks for your reply :)
Thak you too Master-Of-Death.

 Respond  
Jethro   -  Oct 05, 2011

konbob, this should work for both self-trigger and default function:

on *:TEXT:!google *:#: google $2-
alias google {
  set %url /custom?hl=en&client=pub-4099951843714863&cof=FORID%3A1%3BGL%3A1%3BS%3Ahttp%3A%2F%2Fwww.hyperwords.net%2F%3BL%3Ahttp%3A%2F%2Fwww.hyperwords.net%2Fhy-for-google.gif%3BLH%3A100%3BLW%3A100%3BLBGC%3AFFFFFF%3BLP%3A1%3BLC%3A%230033cc%3BVLC%3A%23333333%3BGALT%3A%23999999%3B&q= $+ $1- $+ &btnG=Search
  set %chan $chan
  set %google (http://\S+.\S+.(com|co\.uk|org|ca|au)\S+)
  sockopen google www.google.com 80
}
on *:SOCKOPEN:google:{
  sockwrite -n $sockname GET %url HTTP/1.0
  sockwrite -n $sockname HOST: www.google.com $+ $crlf $+ $crlf 
}
on *:SOCKREAD:google:{
  sockread %googlelink
  if (%google1 == 3) { 
    unset %google1
    sockclose $sockname
    halt
  }
  elseif ($regex(google,%googlelink,%google)) && (google !isin $regml(google,1)) {
    inc %google1 1
    msg %chan 4Search Result: 12 $remove($regml(google,1),")
  }
}

To trigger this by yourself, use:

/google <YourSearchHere>
 Respond  
konbon   -  Oct 05, 2011

Works great for me.
Question: How can i trigger this myself, with out the use of another client?

 Respond  
xplo   -  Jun 19, 2010

***[SocketError] google [10053] Software caused connection abort

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.