alias radio {
if ($window(@radio)) clear @radio
sockopen Radio40 174.142.79.66 8278
}
on *:sockopen:radio40:{
if (!$sockerr) {
window -e @radio
sockwrite -n $sockname GET / HTTP/1.1
sockwrite -n $sockname Host: 174.142.79.66
sockwrite -n $sockname Accept-Charset: text/html; charset=windows-1252
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; $&
Windows NT 5.2; rv:1.7.3) Gecko/20040913 Firefox/0.10.1
sockwrite -n $sockname Connection: Close | sockwrite -n $sockname $crlf
}
}
alias -l getinfo {
return $regsubex($bvar(&radio.temp,1-).text,/<[^>]*>| |<.*|\t/g,$chr(32))
}
on *:sockread:radio40:{
if (!$sockerr) {
sockread &radio.temp
if (Server is currently down isin $getinfo) echo @radio Server Status: $v1 $+ .
else {
if ($regex($getinfo,/(current song:.*)written/i)) echo @radio $regml(1)
if ($regex($getinfo,/(server status.*) stream/i)) echo @radio $regml(1)
if ($regex($getinfo,/d>(.*\s\050.*\051)/i)) echo @radio Stream Status: $regml(1)
if ($regex($getinfo,/(listener peak: \d+)/i)) echo @radio $regml(1)
if ($regex($getinfo,/(average listen time:.*)/i)) echo @radio $gettok($regml(1),1-5,32)
if ($regex($getinfo,/(stream title:.*)content/i)) echo @radio $regml(1)
if ($regex($getinfo,/(content type:.*)/i)) {
tokenize 32 $regml(1) | echo @radio $1-3 | echo @radio $4-6 | echo @radio $7-9
echo @radio $11-12 | echo @radio $13-15 | echo @radio $16-18
}
}
}
}