Kod:
alias radyo.kanal {
return #notepad
}
alias radyo.host {
return ipadress
}
alias radyo.port {
return 2015
}
alias radyo.adminpass {
return notepadfm
}
alias radyo.sock {
return shoutcast
}
alias getxmltext {
var %tag.open = $+(<, $1, >)
var %tag.close = $+(</, $1, >)
if $pos($2-,%tag.open) {
var %start = $ifmatch + $len(%tag.open)
var %length = $calc($pos($2-, %tag.close) - %start)
return $mid($2-, %start, %length)
}
return $null
}
on 1:SOCKOPEN:$($radyo.sock): {
sockwrite -n $sockname GET $+(/admin.cgi?pass=,$radyo.adminpass,&mode=viewxml HTTP/1.1)
sockwrite -n $sockname Host: $+($radyo.host, :, $radyo.port)
sockwrite -n $sockname User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7) Gecko/20040614 Firefox/0.8
sockwrite -n $sockname *.*, */*
; sockwrite -n $sockname Accept-Language: en-us,en;q=0.5
sockwrite -n $sockname Accept-Language: tr,tr;q=0.5
sockwrite -n $sockname Accept-Encoding: gzip,deflate
sockwrite -n $sockname Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
sockwrite -n $sockname Keep-Alive: 300
sockwrite -n $sockname Connection: keep-alive
sockwrite -n $sockname $crlf
}
on 1:SOCKREAD:$($radyo.sock): {
var %data
sockread -f %data
while $sockbr > 0 && $sockerr == 0 {
if $getxmltext(SERVERTITLE, %data) != $null {
set %servertitle $remove($ifmatch,ÿ,&)
}
if $getxmltext(CURRENTLISTENERS, %data) != $null {
set %currentlisteners $ifmatch
}
if $getxmltext(SONGTITLE, %data) != $null {
set %songtitle $remove($ifmatch,ÿ,&)
}
if $getxmltext(BITRATE, %data) != $null {
set %bitrate $ifmatch
}
if $getxmltext(PEAKLISTENERS, %data) != $null {
set %peaklisteners $ifmatch
}
if $getxmltext(SERVERGENRE, %data) != $null {
set %genre $remove($ifmatch,ÿ,&)
}
sockread -f %data
}
}
on 1:SOCKCLOSE:$($radyo.sock): {
if %songtitle != %lastsong {
set %lastsong %songtitle
var %msg = 0,4 %genre su anda online 10,2 Siradaki parca: %songtitle 0,6 Su anda $calc(6+ ( %currentlisteners ) ) kisi dinliyor ( rekor: $calc(6+ %peaklisteners $+ ) )
set %msg2 0,4 %genre su anda online 0,2 Siradaki parca: %songtitle 0,4<< 0,5 Radyomuzu dinlemek icin tiklayin 0,4 >> 78.111.100.31:2015/listen.pls
;msg $radyo.kanal Yayinda su an << $+ %genre $+ >> bulunmakta. * Yayin turu: %servertitle * Calan parca: >>>>> %songtitle <<<<<
msg $radyo.kanal %msg
msg $radyo.kanal 1 Radyomuzu dinlemek icin tiklayin 0,4 >> 78.111.100.31:2015/listen.pls
}
}
alias shout {
if $sock(shoutcast) {
sockclose $ifmatch
}
sockopen $radyo.sock $radyo.host $radyo.port
}
on 1:text:*:#notepad:{
if *!durum* iswm $1- {
set -u10 %durum 1
unset %lastsong
.timershout 0 5 shout
}
}
Not : 1 kere !durum yaptiginizda parca degistigi zaman otomatik olarak durum atacaktir.