is there a way do to a script that detects if Soulseek server is up or down and what version is the most recent?
I have searched for it but I can't find it...
Code: Select all
# Set the chans you want to enable it in to +news
# .chanset #channel +news
# set this to the URL of the news file
set newsfile "http://someurl.com/file.txt"
# want the answer to come out in notice (0) or privmsg (1)?
set tellwho 0
setudef flag news
if ![info exists egghttp(version)] {
putlog "egghttp.tcl was NOT successfully loaded."
return
}
bind pub - !news getlist
proc getlist {nick uhost hand chan text} {
if ![channel get $chan news] return
set sock [egghttp:geturl $::newsfile [list processlist $nick]]
}
proc processlist {nick sock} {
set data [egghttp:headers $sock]
egghttp:cleanup $sock
set parse 0
foreach line [split $data \n] {
if $parse&&![string match ####* $line] {
if $::tellwho {
putserv "NOTICE $nick :$line"
} {
putserv "PRIVMSG $nick :$line"
}
}
if [string match -no Content-Type:* $line] {set parse 1}
}
}