A snippet to retrieve the latest snippet. Enjoy. This is a very simple version, someboy may improve it if they feel like it
;Usage: somebody must type !snippet in the channel
;If somebody types:
; !snippet <-- Messages latest mirc snippet
; !snippet mirc <-- Also messages latest mirc snippet
; !snippte php <-- Messages latest php snippet
; !snippet tcl <-- Messages latest tcl snippet
;As you can see '!snippet' is enough to retrieve a mirc snippet
on *:TEXT:!snippet*:#:{
var %sock = $+(hawkee,#,$nick), %type = $iif($2 isin tcl php,$v1,mirc)
;msg # Now checking http://www.hawkee.com for the latest snippet...
if ($sock(%sock)) return
sockopen %sock www.hawkee.com 80
sockmark %sock $lower(%type) #
}
on *:SOCKOPEN:hawkee*:{
var %a = sockwrite -n $sockname
%a GET $+(/snippets.php?snippet_type=,$getmark($sockname,1)) HTTP/1.1
%a Host: www.hawkee.com
%a Connection: close
%a $crlf
}
on *:SOCKREAD:hawkee*:{
var %temp, %re = <a href="snippet.php\?snippet_id=([[:digit:]]+)">(.+)</a>
sockread %temp
if ($regex(%temp,%re) && ($regml(0) = 2)) {
msg $getmark($sockname,2) Latest $+($chr(31),$getmark($sockname,1),$chr(31)) snippet: $&
$+($chr(2),NAME,$chr(2)): $regml(2) $+($chr(2),URL,$chr(2),:) $&
$+($chr(31),$chr(3),12,http://www.hawkee.com/snippet.php?snippet_id=,$regml(1),$chr(3),$chr(31))
sockclose $sockname
}
}
alias -l getmark return $gettok($sock($1).mark,$$2,32)
;msg # Now checking http://www.hawkee.com for the latest snippet...
Don\'t know if you wanted the \';\' there, just wanted to point that out. I like this idea, and It would be nice if someone could update this to download perhaps maybe one of the top ten scripts on command? And the same with snippets, like someone type the snippet name, it checks the archive and returns it, then they select which one they want and they can download it. Thats a bit extreme though. I give this a 8, I can perdict more to come to this same idea on here.