alias shout.admin { return admin } alias shout.adpass { return lol } alias shout.server { return 216.86.150.15 } alias shout.port { return 8500 } on *:sockclose:ShoutCastXML:{ ;These unset variables used for pushing back data, leave ;these in here ALWAYS! unset %remainder unset %hpushback unset %spushback ;Begin what you wanna do after data is recieved with ;the $shoutcast() function if (%thesong != $shoutcast(SONGTITLE)) { msg #esradio 0,1±15±14± 4eS0ports4R0adio 14±15±0±15±14± 4 $+ $left($shoutcast(SERVERTITLE),1) $+ 0 $+ $mid($shoutcast(SERVERTITLE),2) 14±15±0±15±14± 4N0ow Playing: 04 $+ $left($shoutcast(SONGTITLE),1) $+ 00 $+ $mid($shoutcast(SONGTITLE),2) 14±15±0± } if (%retrieve.dj) { msg #esradio 0,1±15±14± 4eS0ports4R0adio 14±15±0±15±14± 4 $+ $left($shoutcast(SERVERTITLE),1) $+ 0 $+ $mid($shoutcast(SERVERTITLE),2) 14±15±0± } if (%retrieve.song) { msg #esradio 0,1±15±14± 4eS0ports4R0adio 14±15±0±15±14± 4 $+ $left($shoutcast(SERVERTITLE),1) $+ 0 $+ $mid($shoutcast(SERVERTITLE),2) 14±15±0±15±14± 4C0urrent Song: 04 $+ $left($shoutcast(SONGTITLE),1) $+ 00 $+ $mid($shoutcast(SONGTITLE),2) 14±15±0± } if (%retrieve.listeners) { msg #esradio 0,1±15±14± 4eS0ports4R0adio 14±15±0±15±14± 4 $+ $left($shoutcast(SERVERTITLE),1) $+ 0 $+ $mid($shoutcast(SERVERTITLE),2) 14±15±0±15±14± 04 $+ $left($shoutcast(CURRENTLISTENERS),1) $+ 00 $+ $mid($shoutcast(CURRENTLISTENERS),2) $+ /04 $+ $left($shoutcast(MAXLISTENERS),1) $+ 00 $+ $mid($shoutcast(MAXLISTENERS),2) listeners! (Server peak of 04 $+ $left($shoutcast(PEAKLISTENERS),1) $+ 0 $+ $mid($shoutcast(PEAKLISTENERS),2) $+ ) 14±15±0± } if (%retrieve.stream) { msg #esradio 0,1±15±14± 4eS0ports4R0adio 14±15±0±15±14± 4 $+ $left($shoutcast(SERVERTITLE),1) $+ 0 $+ $mid($shoutcast(SERVERTITLE),2) 14±15±0±15±14± 4C0urrently Playing: 04 $+ $left($shoutcast(SONGTITLE),1) $+ 00 $+ $mid($shoutcast(SONGTITLE),2) 14±15±0±15±14± 4T0une in at Http://4l0isten.4eSR0adio.net 14±15±0± } set %thesong $shoutcast(SONGTITLE) echo -a *** Finished Hashing Shoutcast Information... unset %retrieve.* } alias getshoutcastinfo { sockopen ShoutCastXML $shout.server $shout.port hfree -w ShoutCast BufferSCOut ShoutCastXML echo -a *** Hashing Shoutcast Information... } alias shoutcast { if ($1 = song) { if ($2 = 0) { return $hfind(ShoutCast,SONG.*.PLAYEDAT,0,w) } else { return $hget(ShoutCast,$+(Song.,$2,.,$prop)) } } elseif ($1 = Listener) { if ($2 = 0) { return $hfind(ShoutCast,LISTENER.*.HOSTNAME,0,w) } else { return $hget(ShoutCast,$+(LISTNER.,$2,.,$prop)) } } else { return $hget(ShoutCast,$1) } } alias BufferSCOut { if ($sock($1)) { if ($sock($1).status = connecting) { .timer 1 1 BufferSCOut $1- } elseif ($sock($1).status = active) { sockwrite -n ShoutCastXML GET /admin.cgi?mode=viewxml HTTP/1.1 sockwrite -n ShoutCastXML User-Agent: Mozilla/5.0 (Windows NT 5.1; U; en) Opera 9.01 sockwrite -n ShoutCastXML Host: $shout.server sockwrite -n ShoutCastXML Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1 sockwrite -n ShoutCastXML Accept-Language: en-US,en;q=0.9 sockwrite -n ShoutCastXML Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1 sockwrite -n ShoutCastXML Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0 sockwrite -n ShoutCastXML Authorization: Basic $encode($+($shout.admin,:,$shout.adpass),m) sockwrite -n ShoutCastXML Cache-Control: no-cache sockwrite -n ShoutCastXML Connection: Keep-Alive, TE sockwrite -n ShoutCastXML TE: deflate, gzip, chunked, identity, trailers sockwrite -n ShoutCastXML $crlf } } } alias processtag { var %String $remove($1,,,,,,,,,,,,) var %match = $regex(Tags,%String,/<(.*?)>.*?<\/.*?>/) , %TheTag = $regml(Tags,1) var %match = $regex(Tags,%String,/<.*?>(.*?)<\/.*?>/) , %TagVal = $regml(Tags,1) if (%TheTag) { if (%TheTag = HOSTNAME) { %hpushback = $hfind(ShoutCast,LISTNER.*.HOSTNAME,0,w) | inc %hpushback 1 } elseif (%TheTag = PLAYEDAT) { unset %hpushback | %spushback = $hfind(ShoutCast,SONG.*.PLAYEDAT,0,w) | inc %spushback 1 } if (%hpushback) { hadd -m ShoutCast $+(Listener.,%hpushback,.,%TheTag) %TagVal } elseif (%spushback) { hadd -m ShoutCast $+(Song.,%spushback,.,%TheTag) $regsubex(%TagVal,/&#x(..);/g,$chr($base(\t,16,10))) } else { hadd -m ShoutCast %TheTag $regsubex(%TagVal,/&#x(..);/g,$chr($base(\t,16,10))) } if ($1 = UID) { unset %hpushback } if ($1 = TITLE) { unset %spushback } } } on *:sockread:ShoutCastXML:{ var %temp = "" if ($sockerr > 0) { return } if ($sock($sockname,1).sq >= 8000) { return } :loop | if ($sock($sockname)) { sockread -f %temp } else { return } if (%temp != $null) { var %len = $len(%temp) var %temp2 = $mid(%temp,801) %remainder = $regsubex($+(%remainder,$mid(%temp,1,800)),/<\!.*?>/g,) %remainder = $regsubex(%remainder,/<\?.*?>/g,) %remainder = $regsubex(TagSep,%remainder,/(<.*?>.*?<\/.*?>)/g,$processtag(\t)) %remainder = $regsubex(%remainder,/<.*?>.*?<\/.*?>/g,) $+ %temp2 } if ($sockbr == 0) { return } goto loop } on *:TEXT:*:#esradio:{ if (%spamprotect) { halt } else { if ($1 == .dj) { getshoutcastinfo | set %retrieve.dj 1 | set -u6 %spamprotect 1 } if ($1 == .stream) { getshoutcastinfo | set %retrieve.stream 1 | set -u6 %spamprotect 1 } if ($1 == .song) { getshoutcastinfo | set %retrieve.song 1 | set -u6 %spamprotect 1 } if ($1 == .listeners) { getshoutcastinfo | set %retrieve.listeners 1 | set -u6 %spamprotect 1 }