westor

Website Up/Down Checker for Konrado v1.0

Jan 22nd, 2021
996
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ON $*:TEXT:/^([!@])is(up|down) (?<=^| )((?>[a-z]{3,6}\072\/\/|w{3}\.)\S+)/Si:#:{
  2.   if ($hget(ISUP_FLOOD,$nick)) { return }
  3.  
  4.   if ($regml(1) == !) { var %output = notice $nick }
  5.   if ($regml(1) == @) { var %output = msg $chan }
  6.  
  7.   hadd -mu6 ISUP_FLOOD $nick 1
  8.  
  9.   var %t = $regml(3)
  10.   var %v = isup_ $+ $rand(1,1000000000000000)
  11.  
  12.   jsonopen -Udi %v %t
  13.  
  14.   if ($jsonerror) { %output ( $+ $nick $+ ): Website $qt(%t) is down! | return }
  15.  
  16.   var %r = $json(%v).httpstatustext
  17.  
  18.   if (%r !== OK) { %output ( $+ $nick $+ ): Website $qt(%t) is down right now! | return }
  19.  
  20.   %output ( $+ $nick $+ ): Website $qt(%t) is up and running.
  21. }
  22.  
RAW Paste Data