Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ON $*:TEXT:/^!uptime(\s\w+)?$/iS:#: {
- if ($nick !isop #) {
- if ((%flooduptime) || ($($+(%,flooduptime.,$nick),2)) || ($($+(%,floodUser.,$nick),2))) { return }
- set -u30 %flooduptime on
- set -u60 %flooduptime. $+ $nick On
- set -u60 %floodUser. $+ $nick On
- }
- VAR %chan $IIF($2,$2,$remove($chan,$chr(35)))
- JSONOpen -uw uptime https://api.twitch.tv/kraken/streams/ $+ %chan $+ ?nocache= $+ $ticks
- JSONUrlHeader uptime Client-ID
- JSONUrlGet uptime
- MSG $chan /me %chan $IIF($JSON(uptime, stream, created_at),has been live for $duration($calc($ctime - $TwitchTime($JSON(uptime, stream, created_at))),2) $+ .,is not live at the moment.)
- JSONClose uptime
- }
- :// https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/ $+ %chan $+ ?nocache= $+ $ticks
- :// JSONOpen -uw followCheck https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/cyanideplaysgames ?nocache= $+ $ticks
- on $*:text:/^!loyal(\s\w+)?$/iS:#: {
- if ($chan != #sovietwomble) {
- if ($nick !isop #) {
- if ((%floodloyal) || ($($+(%,floodloyal.,$nick),2)) || ($($+(%,floodUser.,$nick),2))) { return }
- set -u30 %floodloyal on
- set -u60 %floodloyal. $+ $nick On
- set -u60 %floodUser. $+ $nick On
- }
- VAR %chan $IIF($2,$2,$remove($chan,$chr(35)))
- JSONOpen -uw followCheck https://api.twitch.tv/kraken/users/ $+ $nick $+ /follows/channels/ $+ %chan $+ ?nocache= $+ $ticks
- JSONUrlHeader followCheck Client-ID
- JSONUrlGet followCheck
- MSG # /me $nick $IIF($JSON(followCheck, created_at), has been following %chan for $replace($duration($calc($ctime - $TwitchTime($JSON(followCheck, created_at))),2),wks,$chr(32) $+ weeks $+ $chr(44),wk,$chr(32) $+ week $+ $chr(44),days,$chr(32) $+ days $+ $chr(44),hrs,$chr(32) $+ hours and $+ $chr(44),mins,$chr(32) $+ minutes), is not following %chan)
- JSONClose followCheck
- }
- }
- alias TwitchTime {
- if ($regex($1-, /^(\d\d(?:\d\d)?)-(\d\d)-(\d\d)T(\d\d)\:(\d\d)\:(\d\d)(?:(?:Z$)|(?:([+-])(\d\d)\:(\d+)))?$/i)) {
- var %m = $Gettok(January February March April May June July August September October November December, $regml(2), 32), %d = $ord($base($regml(3),10,10)), %o = +0, %t
- if ($regml(0) > 6) %o = $regml(7) $+ $calc($regml(8) * 3600 + $regml(9))
- %t = $calc($ctime(%m %d $regml(1) $regml(4) $+ : $+ $regml(5) $+ : $+ $regml(6)) - %o)
- if ($asctime(zz) !== 0 && $regex($v1, /^([+-])(\d\d)(\d+)$/)) {
- %o = $regml(1) $+ $calc($regml(2) * 3600 + $regml(3))
- %t = $calc(%t + %o )
- }
- return %t
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement