on *:start:{ timerscheck 0 10 songcheck } alias songcheck { sockclose scstat sockopen scstat server port } on *:SOCKOPEN:scstat:{ sockwrite -n $sockname GET /7.html HTTP/1.0 sockwrite -n $sockname User-Agent: Mozilla sockwrite -n $sockname $crlf } on *:sockread:scstat:{ if ($sockerr > 0) return :nextread sockread -f %scasttemp if ($sockbr == 0) return if (%scasttemp == $null) %scasttemp = empty set %scasttemp $remove(%scasttemp,,) if ((HTTP/1.* !iswm %scasttemp) && (content-type* !iswm %scasttemp) && (%scasttemp != empty)) { set %scstat.song $gettok(%scasttemp,7-,44) set %scstat.bitrate $gettok(%scasttemp,6,44) set %scstat.listeners $gettok(%scasttemp,1,44) set %scstat.maxlist $gettok(%scasttemp,4,44) set %scstat.peak $gettok(%scasttemp,3,44) if ($gettok(%scasttemp,2,44) == 1) set %scstat.livedj connected else set %scstat.livedj not connected ; changing some of the html codes back to regular characters set %scast.song $replace(%scast.song,&,$chr(38),',$chr(39)) } goto nextread } on *:sockclose:scstat:{ if (%old.song != %scstat.song) { set %old.song %scstat.song topic #chan blah blah blah Current Song: %scstat.song } }