Originally Posted By: FroggieDaFrog
If you make use of my JSON for mIRC script (found in my signature) this is quite easy, using twitch's own API:

Code:
on *:TEXT:!uptime*:#: {
  var %json = streamuptime, %stream = $iif(#* iswm $iif($2,$2,#), $mid($v2, 2-), $v2), %time
  jsonopen -ud %json https://api.twitch.tv/kraken/streams?channel= $+ $lower(%stream)
  if ($JSONError) {
    msg # Unable to retrieve the state of %stream
  }
  elseif ($regex($JSON(%json, streams, 0, created_at), /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)Z$/)) {
    %time = $calc($ctime($+($gettok(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec, $regml(2), 32) $ord($base($regml(3), 10, 10)), $chr(44) $regml(1) $regml(4), :, $regml(5), :, $regml(6))) + ( $time(z) * 3600))
    msg # %stream has been online for $duration(%time)
  }
  else {
    msg # %stream is currently not online.
  }
}


Sorry, but that's not right ... xxx has been online for 2412wks 1day 10hrs 44mins 11secs ... nope smile