The $twitch_name is to simply check the Twitch API to see if the target username is valid and to get the proper display name to make it look nicer.

Code:
alias twitch_name {
  IF (%tn == 1000) %tn = 0
  INC %tn
  JSONOpen -uw twitch_name $+ %tn https://api.twitch.tv/kraken/channels/ $+ $1
  JSONUrlHeader twitch_name $+ %tn Client-ID avm4vi7zv0xpjkpi3d4x0qzk8xbrdw8
  JSONUrlGet twitch_name $+ %tn
  VAR %x $json(twitch_name $+ %tn $+ , display_name)
  JSONClose twitch_name $+ %tn
  RETURN %x
}

The reason that I don't use $ticks in this code is because sometimes I need $twitch_name multiple times on one line, and when using $ticks it will not work.

Example using $ticks:
Code:
$twitch_name(Tom) $twitch_name(Dick) $twitch_name(Harry)
will return
Quote:
Tom Tom Tom
most of the time.