ON *:SOCKOPEN:radio: {
sockwrite -nt $sockname GET /json/stream/rumbasfm HTTP/1.1
sockwrite -nt $sockname Host: $my_icecast_url
sockwrite -nt $sockname Connection: Close
sockwrite $sockname $crlf
}
ON *:SOCKREAD:radio: {
var %radio | sockread %radio
}
ON *:SOCKCLOSE:radio: {
var %radio | sockread -f %radio
var %x = 1
while (%x <= $numtok(%radio,34)) {
var %g = $gettok(%radio,%x,34)
if (%g != :) && (%g != ,) && (%g != dummy) && (*null* !iswm %g) && (%g != :{) && (%g != $chr(123)) {
if (icestats == %g) { set %icestats 1 }
if (%icestats == 1) && (%g != icestats) {
if (!%admin) { inc %admin 1 }
if (%admin) { if (!%itva) { inc %itva 1 | set %citem %g }
elseif (%itva) {
if (%citem == servername) { set %servername $replace(%g,$chr(32),chr(32)) }
if (%citem == nowplaying ) { set $+(%,nowplaying,%servernaname) %g }
if (%citem == bitrate) { set $+(%,bitrate,%servername) $remove(%g,:,$chr(44)) }
if (%citem == ice-channels) { set $+(%,ice-channels,%servername) $remove(%g,:,$chr(44)) }
if (%citem == ice-samplerate) { set $+(%,ice-samplerate,%servername) $remove(%g,:,$chr(44)) }
if (%citem == ice-url) { set $+(%,ice-url,%servername) %g }
if (%citem == listener_peak) { set $+(%,listener_peak,%servername) $remove(%g,:,$chr(44)) }
if (%citem == connections) { set $+(%,connections,%servername) $remove(%g,:,$chr(44))
msg $my_icecast_chan $replace(%servername,chr(32),$chr(32)) Now Playing: $($+(%,nowplaying,%servernaname),2) BitRate: $($+(%,bitrate,%servername),2) Channels: $($+(%,ice-channels,%servername),2) SampleRate: $($+(%,ice-samplerate,%servername),2) Listeners: $($+(%,connections,%servername),2) (Peak: $($+(%,listener_peak,%servername),2) )
msg $my_icecast_chan Listen @ $($+(%,ice-url,%servername),2)
unset $+(%,*,%servername)
unset %servername
}
unset %citem %itva
}
}
}
}
inc %x
}
unset %admin %icestats
}
alias my_icecast_url {
;;Input your server's URL below (don't erase "return") >> DON'T INCLUDE THE :PORT <<
return delta.radioplayer.com.ar
}
alias my_icecast_port {
;;Input below the port that the server is listening to (don't erase "return")
return 9260
}
alias my_icecast_chan {
;;Input your the channel(s) you want the messages to be sent in below
;;For multiple channels seperate with a comma , (e.g #chan1,#chan2,#chan3
return #rumbas_adm
}
alias ice_check {
if (!%ice_check) {
set %ice_check 1
.timerice_check 0 250 sockopen radio $my_icecast_url $my_icecast_port
echo -at Ice Cast Info Is Now On!
}
elseif (%ice_check) {
unset %ice_check
.timerice_check off
echo -at Ice Cast Info Is Now Off!
}
}