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
}
}