on *:TEXT:!sts:#: {
if ($sock(st)) .sockclose st
sat
}
alias sat {
sockopen st api.twitch.tv 443
echo t0
}
on *:SOCKOPEN:st: {
sockwrite -nt $sockname GET /kraken/streams/anubisxhades HTTP/1.1
sockwrite -nt $sockname Host: api.twitch.tv
sockwrite $sockname $crlf
echo t1
}
on *:SOCKREAD:st: {
if (!$sockerr) { echo -a SOCKET ERROR: $sockerr }
else {
var %sockreader
sockread %sockreader
sockclose st
echo t2
}
}