Try use this code:

Usage: /test twitch-channel
Example: /test starladder5

Code:
alias test {
  if (!$1) { echo 4 -a Error: Please specify a channel! | return }
  if ($sock(test)) { sockclose test }
  sockopen test twitchviewerlist.com 80
  sockmark test $1
}

on *:sockopen:test:{
  sockwrite -n $sockname GET / $+ $sock($sockname).mark HTTP/1.1
  sockwrite -n $sockname Host: $sock($sockname).addr
  sockwrite -n $sockname user-agent: Mozilla/*
  sockwrite -n $sockname Connection: Keep-Alive
  sockwrite -n $sockname $crlf
}

on *:sockread:test:{
  if ($sockerr > 0) return
  :nextread
  sockread %temp
  if ($sockbr == 0) return
  echo -ag %temp
  goto nextread
}