Code:
alias radio {
  if ($window(@radio)) clear @radio
  sockopen Radio40 174.142.79.66 8278
}
on *:sockclose:radio40:{
  echo @radio Server Status: Server is currently down.
}
alias -l getinfo {
  return $regsubex($bvar(&radio.temp,1-).text,/<[^>]*>|&nbsp;|<.*/g,$chr(32))
}
on *:sockopen:radio40:{
  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
}
on *:sockread:radio40:{
  sockread &radio.temp
  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
    sockclose $sockname
  }
}



Last edited by Tomao; 07/11/11 10:14 PM.