This is my hawkee searcher snippet :), you can type /search or have another user type !Search . The only way to see how good it is, is to try it yourself :).
-Updated as of 06/10/2010 & The problem was hawkee made it so it required a / at the end of the url :]. Simple fix.
on $*:TEXT:/^[.!@]Search/Si:#hawkee: {
if (!$timer(Search)) {
search $2-
.timersearch 1 6 noop
set %outatm $iif(@* iswm $1,msg #,notice $nick)
}
}
alias nohtml {
var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, )
return %x
}
alias search {
var %sock $+(HawkeeSearch,$replace($1-,$chr(32),+))
if ($sockname(%sock)) .sockclose %sock
sockopen %sock www.hawkee.com 80
}
on *:SOCKOPEN:HawkeeSearch*: {
sockwrite -nt $sockname GET $+(/snippets/search/,$remove($sockname,HawkeeSearch),/) HTTP/1.1
sockwrite -nt $sockname Host: www.hawkee.com
sockwrite -nt $sockname $crlf
}
on *:SOCKREAD:HawkeeSearch*: {
if (!$sockerr) {
var %Quote
sockread %Quote
tokenize 32 %quote
if (We couldn't find any snippets to match your search. isin $1-) {
%outatm $dsz((Search) No queries could be found for your search " $remove($sockname,hawkeesearch) ")
sockclose $sockname
}
if (snippet isin $1-) && (large isin $1-) {
hadd -m $sockname Title $remove($nohtml($1-),$crlf,$chr(9))
tokenize 39 $1-
hadd -m $sockname Scurl $2
}
if (added: isin $1-) hadd -m $sockname Date $nohtml($1-)
if (by isin $1-) && (profile isin $1-) {
hadd -m $sockname Maker $nohtml($1-)
tokenize 39 $1-
hadd -m $sockname Prurl $4
set %desc 2
}
if ($nohtml($remove($1-,br,<,>)) == $remove($1-,br,<,>)) && (%desc) {
hadd -m $sockname Desc $remove($nohtml($1-),<br>,$chr(40),$chr(41))
dec %desc
}
if (score isin $1-) hadd -m $sockname Score $nohtml($1-)
if (#comment isin $1-) hadd -m $sockname Cmtot $nohtml($1-)
if (platform isin $1-) && (script !isin $1-) {
tokenize 47 $1-
hadd -m $sockname Platform $remove($gettok($remove($4,.png),1,32),$chr(41))
var %tmsg (Search) ( $+ $hget($sockname,title) $+ ) (http://www.hawkee.com $+ $hget($sockname,scurl) $+ ) (Made $hget($sockname,maker) ( $+ $hget($sockname,prurl) $+ ) $+ ) ( $+ $hget($sockname,date) $+ ) (Platform: $hget($sockname,platform) $+ ) ( $+ $hget($sockname,score) $+ ) ( $+ $hget($sockname,cmtot) $+ ) (Description: $hget($sockname,desc) $+ )
$iif(%outatm,$v1,echo) $dsz($remove(%tmsg,$chr(9)))
sockclose $sockname
}
}
}
alias dsz return $Replace($1-,$chr(40),12 $+ $chr(40) $+ 14,$chr(41),12 $+ $chr(41) $+ 14)
:)
[07:37am] « ~BourneIdent » !search mp3
[07:37am] -%HelpDesk- (Search) (BeerBot v1) (http://www.hawkee.com/snippet/7918/) (Made By: hxck (http://www.hawkee.com/profile/57391/)) (Added: Sep 03, 2010) (Platform: mirc) (Score: 0.0) (2 comment(s)) (Description: The code could be a lot better, I know that. This is my first bigger project, way more than I've ever done at once.)
same thing no matter what i search and * /sockclose: insufficient parameters everytime can you fix this up