Froogle search

By Daveoh on Dec 08, 2006

Searches froogle (Google's shopping search engine) for items and returns the first four.
Use: !froogle
Warning: Make sure you have flood protection on or you are allowed to send the required amount of text.

To change the number of results, change the number in the line
if (%i <= 4) {
You can change it to the US search by changing all the '.co.uk' in the file.

;; Froogle search | by Daveoh @ #kidswithguns on Quakenet
alias -l htmlfree {
  var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x,&,$chr(9))
  return %x
}
on *:TEXT:!froogle *:#:{ if (%froogle.spam) { halt } | set -u6 %froogle.spam 1
  set %froogle.search $2- | set %froogle.chan $chan | set %i 1
  if ($sock(froogle)) { sockclose froogle }
  sockopen froogle froogle.google.co.uk 80
}
on *:sockopen:froogle:{
  sockwrite -n $sockname GET /froogle?q= $+ %froogle.search HTTP/1.0
  sockwrite -n $sockname Host: froogle.google.co.uk
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname $crlf
}
on 1:sockread:froogle:{
  :nextread
  if ($sockerr > 0) return
  sockread %temp
  if ($sockbr == 0) return

  if (%i <= 4) { 
    if (<a style="font-size:medium"* iswm %temp) { set %froogle.result. $+ %i $+ .name $htmlfree(%temp) }
    if (%froogle.result.price == 1) { set %froogle.result. $+ %i $+ .price %temp | inc %i | unset %froogle.result.price }
    if (<b><span style="font-size:medium"> == %temp) { set %froogle.result.price 1 } 
    goto nextread
  }
  elseif (%i) {
    msg %froogle.chan Froogle results:
    set %i 1
    while ($var(%froogle.result.*.name,%i) != $null) {
      msg %froogle.chan %i $+ : $var(%froogle.result.*.name,%i).value @ $var(%froogle.result.*.price,%i).value
      inc %i
    }
    msg %froogle.chan Results page: http://froogle.google.co.uk/froogle?q= $+ %froogle.search
    unset %froogle* | unset %i | unset %temp
  }
}

Comments

Sign in to comment.
Lindrian   -  Dec 08, 2006

I aint able to get this working!!
I\'ve done everything im supposed to do, but still, if anyone types \"!Froogle\" nothing appears.

 Respond  
Daveoh   -  Dec 08, 2006

Added results URL after the list

 Respond  
Lindrian   -  Dec 08, 2006

So, this is a \"google\" in the actuall MIRC?

 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.