1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
on *:CONNECT: { /timer1 0 5 _getinfo }
alias _getinfo sockclose getinfo | sockopen getinfo thlradio.com 80
alias getinfo { !return $hget(getinfo,$iif($1,$v1,0)) }
on *:SOCKOPEN:getinfo: {
sockwrite -n $sockname GET /mirc/stats.php HTTP/1.1
sockwrite -n $sockname Host: thlradio.com
sockwrite -n $sockname User-Agent: Mozilla/4.5 [en] (X11; U; Linux 2.2.9 i586)
sockwrite -n $sockname
}
on *:SOCKREAD:getinfo: {
var %r
sockread %r
tokenize 42 %r
if ($0) {
hadd -m getinfo dj $1
hadd getinfo listeners $2
hadd getinfo peak $3
hadd getinfo max $4
hadd getinfo unique $5
hadd getinfo bits $6
hadd getinfo artist $7
hadd getinfo title $8
if ($getinfo(listeners) > $djpeak($replace($getinfo(dj),$chr(32),_)) {
hadd getinfo $+(djpeaks,.,$getinfo(dj)) $getinfo(listeners)
msg #thlradio.dev $getinfo(dj) has a new peak of $getinfo(listeners) listeners.
}
}
}
on *:TEXT:!song:#: { msg $chan Current Song: $getinfo(artist) - $getinfo(title) $djpeak }
on *:TEXT:!l:#: { msg $chan listeners: $getinfo(listeners) }
|