Website Check with Dialog

By Defero on Oct 07, 2013

This is a website check script.
It checks if a website is online or offline (Like the script of dronez4) but with Dialogs!
Either type /check or right click anywhere and press Website Check.
Report any bugs etc. on the IRC: irc.quakenet.org Port: 6667 Channel: #Defero or in the comments!
Have fun!

alias check {
  dialog -m Check Check
}

menu * {
  Website Check:/dialog -m Check Check
}

dialog Check {
  size -1 -1 150 55
  title "Website Check"
  option dbu
  text "Made by Defero", 1, 3 47 40 6
  box "", 2, 1 44 42 12
  text "Website Link here:", 3, 53 2 70 6
  edit "", 4, 5 10 140 10
  button "Check Website", 5, 42 23 65 20, ok
}

on *:dialog:Check:sclick:5:{
  if ($did(4).edited == $true) {
    copen $did(4)
  }
  else {
    echo -a The website " $+ $did(4) $+ " is unknown to me
  }
}

alias copen {
  sockclose checks
  sockopen checks www.downforeveryoneorjustme.com 80
  set %check $1
}

on *:sockopen:checks:{
  if (!$sockerr) {
    sockwrite -nt checks GET / $+ %check HTTP/1.0
    sockwrite -n checks Host: www.downforeveryoneorjustme.com
    sockwrite -n checks $crlf
  }
}

on *:sockread:checks:{
  if ($sockerr > 0) { return }
  else {
    var %checkr
    sockread %checkr
    if (*is UP* iswm %checkr) {
      echo -a 1[9ONLINE1]: 7The website %check is 9Online!
    }
    if (*looks down from* iswm %checkr) {
      echo -a 1[4OFFLINE1]: 7The website %check is 4Offline!
    }
    if (*doesn't look like* iswm %checkr) {
      echo -a 1[2UNKNOWN1]: 7The website %check is 2Unknown!
    }
  }
}

Comments

Sign in to comment.
dma   -  Feb 11, 2016

nice and easy script dont stop it's 2016 dma - irc.suckerpunch.pw #irc

 Respond  
dronez4   -  Oct 07, 2013

Hello, Thanks for using my script, First thing, its looking nice...

Except one little error, that caught my eye, and the whole script doesnt work when you do that

alias copen {
    sockclose checks
    sockopen checks www.downforeveryoneorjustme.com 80
    set %check $1
  }
}

That last bracket does not need to be there, otherwise it breaks the whole script, otherwise it works nice

Defero  -  Oct 07, 2013

Thanks ^^ haven't noticed it :D

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.