I am trying to modify an existing script, right now it requires the command !song to be typed in the channel, I want to change it to just display the current song every 5 minutes.. the code is:
bind pub -|- !song get_shoutcast_song
bind pub -|- !np get_shoutcast_song
proc get_shoutcast_song {nick uhost hand chan arg} {
global url streamch
set streamch [string tolower $streamch]
::http::config -useragent "Mozilla/5.0; Shoutinfo"
if {[string tolower $chan] == "$streamch"} {
set http_req [::http::geturl $url -timeout 2000]
if {[::http::status $http_req] != "ok"} {
puthelp "PRIVMSG $chan :Stream is unavailable";
}
set data [::http::data $http_req]
::http::cleanup $http_req
if {[regexp {<font class=default>Current Song: </font></td><td><font class=default><b>([^<]+)</b>} $data x title]} {
puthelp "PRIVMSG $chan :\002Current Song\002: $title"
} else {
puthelp "PRIVMSG $chan :Couldn't receive any information, checking server status..."
get_shoutcast_server $nick $uhost $hand $chan $arg
}
}
}
Any help is appreciated :)