ON *:TEXT:!uptime*:#: {
VAR %stream $IIF($2,$2,$remove(#,$chr(35)))
jsonopen -ud uptime https://api.twitch.tv/kraken/streams/ $+ %stream
IF ($JSONError) MSG $chan Error.
ELSEIF ($regex($JSON(uptime, stream, created_at), /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/)) MSG $chan %stream has been streaming for $duration($calc($ctime - ($ctime($gettok(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec, $regml(2), 32) $regml(3) $regml(1) $regml(4) $+ : $+ $regml(5) $+ : $+ $regml(6)) - 18000)),2) $+ .
ELSE MSG $chan %stream is not online.
}